Skip to content

Commit

Permalink
Add category number; clean up imports in assessments.ts.
Browse files Browse the repository at this point in the history
  • Loading branch information
Matthew-Grayson committed Mar 29, 2024
1 parent 0cc46ef commit b6b3f52
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 9 deletions.
14 changes: 5 additions & 9 deletions backend/src/api/assessments.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
import { validateBody, wrapHandler, NotFound, Unauthorized } from './helpers';
import { connectToDatabase } from '../models';
import { Assessment } from '../models/assessment';
import { Assessment, connectToDatabase } from '../models';
import { isUUID } from 'class-validator';
import { Response } from '../models/response';
import { Question } from '../models/question';
import { Category } from '../models/category';

/**
* @swagger
Expand All @@ -20,7 +16,7 @@ export const createAssessment = wrapHandler(async (event) => {

await connectToDatabase();

const assessment = await Assessment.create(body);
const assessment = Assessment.create(body);
await Assessment.save(assessment);

return {
Expand All @@ -34,11 +30,11 @@ export const createAssessment = wrapHandler(async (event) => {
*
* /assessments:
* get:
* description: Lists all assessments for the logged in user.
* description: Lists all assessments for the logged-in user.
* tags:
* - Assessments
*/
export const listAssessments = wrapHandler(async (event) => {
export const list = wrapHandler(async (event) => {
const userId = event.requestContext.authorizer!.id;

if (!userId) {
Expand Down Expand Up @@ -70,7 +66,7 @@ export const listAssessments = wrapHandler(async (event) => {
* tags:
* - Assessments
*/
export const getAssessment = wrapHandler(async (event) => {
export const get = wrapHandler(async (event) => {
const assessmentId = event.pathParameters?.id;

if (!assessmentId || !isUUID(assessmentId)) {
Expand Down
3 changes: 3 additions & 0 deletions backend/src/models/category.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ export class Category extends BaseEntity {
@Column()
name: string;

@Column({ nullable: true })
number: number;

@Column({ nullable: true })
shortName: string;

Expand Down
Empty file added backend/src/tasks/rscsyncdb.ts
Empty file.
Empty file.

0 comments on commit b6b3f52

Please sign in to comment.