Skip to content

Commit baf6ae5

Browse files
committed
#4001 fix seed data, type not optional
1 parent 273ce76 commit baf6ae5

3 files changed

Lines changed: 18 additions & 5 deletions

File tree

src/backend/src/prisma/seed.ts

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,15 @@ import { dbSeedAllTeams } from './seed-data/teams.seed.js';
2222
import { seedReimbursementRequests } from './seed-data/reimbursement-requests.seed.js';
2323
import ChangeRequestsService from '../services/change-requests.services.js';
2424
import TeamsService from '../services/teams.services.js';
25-
import { DayOfWeek, MaterialStatus, RoleEnum, StandardChangeRequest, WbsElementStatus, WorkPackageStage } from 'shared';
25+
import {
26+
DayOfWeek,
27+
GuestDefinitionType,
28+
MaterialStatus,
29+
RoleEnum,
30+
StandardChangeRequest,
31+
WbsElementStatus,
32+
WorkPackageStage
33+
} from 'shared';
2634
import TasksService from '../services/tasks.services.js';
2735
import { seedProject } from './seed-data/projects.seed.js';
2836
import { seedWorkPackage } from './seed-data/work-packages.seed.js';
@@ -5120,6 +5128,7 @@ const performSeed: () => Promise<void> = async () => {
51205128
term: 'NER',
51215129
description: 'A really awesome organization!',
51225130
order: 0,
5131+
type: 'INFO_PAGE',
51235132
organizationId,
51245133
userCreatedId: batman.userId
51255134
}
@@ -5131,6 +5140,7 @@ const performSeed: () => Promise<void> = async () => {
51315140
'Projects',
51325141
'This is the definition of a project. Projects are blah blah blah',
51335142
0,
5143+
GuestDefinitionType.PROJECT_MANAGEMENT,
51345144
'bar_chart',
51355145
'Click here to view all our projects!',
51365146
'/projects'
@@ -5142,6 +5152,7 @@ const performSeed: () => Promise<void> = async () => {
51425152
'Change Requests',
51435153
'This is the definiton for a change request. Changes requests are blah blah blah',
51445154
0,
5155+
GuestDefinitionType.PROJECT_MANAGEMENT,
51455156
'bar_chart',
51465157
'Click here to view all our change requests!',
51475158
'/change-requests'
@@ -5153,6 +5164,7 @@ const performSeed: () => Promise<void> = async () => {
51535164
'Gantt Chart',
51545165
'This is the definiton for a change request. Changes requests are blah blah blah',
51555166
0,
5167+
GuestDefinitionType.PROJECT_MANAGEMENT,
51565168
'bar_chart',
51575169
'Click here to view all our projects!',
51585170
'/gantt'
@@ -5164,6 +5176,7 @@ const performSeed: () => Promise<void> = async () => {
51645176
'Design Reviews',
51655177
'This is the definiton for a design review. Design reviews are blah blah blah',
51665178
0,
5179+
GuestDefinitionType.PROJECT_MANAGEMENT,
51675180
'bar_chart',
51685181
'Click here to view all our design reviews!',
51695182
'/design-reviews'

src/backend/src/routes/recruitment.routes.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ recruitmentRouter.post(
5757
nonEmptyString(body('term')),
5858
nonEmptyString(body('description')),
5959
body('order').isInt(),
60-
nonEmptyString(body('type')).optional(),
60+
nonEmptyString(body('type')),
6161
nonEmptyString(body('icon')).optional(),
6262
nonEmptyString(body('buttonText')).optional(),
6363
nonEmptyString(body('buttonLink')).optional(),
@@ -70,7 +70,7 @@ recruitmentRouter.post(
7070
nonEmptyString(body('term')),
7171
nonEmptyString(body('description')),
7272
body('order').isInt(),
73-
nonEmptyString(body('type')).optional(),
73+
nonEmptyString(body('type')),
7474
nonEmptyString(body('icon')).optional(),
7575
nonEmptyString(body('buttonText')).optional(),
7676
nonEmptyString(body('buttonLink')).optional(),

src/backend/src/services/recruitment.services.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,7 @@ export default class RecruitmentServices {
232232
term: string,
233233
description: string,
234234
order: number,
235-
type?: GuestDefinitionType,
235+
type: GuestDefinitionType,
236236
icon?: string,
237237
buttonText?: string,
238238
buttonLink?: string
@@ -306,7 +306,7 @@ export default class RecruitmentServices {
306306
description: string,
307307
definitionId: string,
308308
order: number,
309-
type?: GuestDefinitionType,
309+
type: GuestDefinitionType,
310310
icon?: string,
311311
buttonText?: string,
312312
buttonLink?: string

0 commit comments

Comments
 (0)