Skip to content

Commit c887a76

Browse files
authored
Merge pull request #146 from imcaizheng/full-update-full-record
Fix PUT operations: fully replace the content of a record with a new one
2 parents bc9915e + 3d107fa commit c887a76

File tree

4 files changed

+17
-18
lines changed

4 files changed

+17
-18
lines changed

docs/swagger.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1993,7 +1993,6 @@ components:
19931993
required:
19941994
- projectId
19951995
- userId
1996-
- status
19971996
- rateType
19981997
properties:
19991998
projectId:

src/services/JobCandidateService.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -173,9 +173,9 @@ fullyUpdateJobCandidate.schema = Joi.object().keys({
173173
data: Joi.object().keys({
174174
jobId: Joi.string().uuid().required(),
175175
userId: Joi.string().uuid().required(),
176-
status: Joi.jobCandidateStatus(),
177-
externalId: Joi.string().allow(null),
178-
resume: Joi.string().uri().allow(null)
176+
status: Joi.jobCandidateStatus().default('open'),
177+
externalId: Joi.string().allow(null).default(null),
178+
resume: Joi.string().uri().allow(null).default(null)
179179
}).required()
180180
}).required()
181181

src/services/JobService.js

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -252,17 +252,17 @@ fullyUpdateJob.schema = Joi.object().keys({
252252
id: Joi.string().guid().required(),
253253
data: Joi.object().keys({
254254
projectId: Joi.number().integer().required(),
255-
externalId: Joi.string().allow(null),
256-
description: Joi.stringAllowEmpty().allow(null),
255+
externalId: Joi.string().allow(null).default(null),
256+
description: Joi.stringAllowEmpty().allow(null).default(null),
257257
title: Joi.title().required(),
258-
startDate: Joi.date().allow(null),
259-
duration: Joi.number().integer().min(1).allow(null),
258+
startDate: Joi.date().allow(null).default(null),
259+
duration: Joi.number().integer().min(1).allow(null).default(null),
260260
numPositions: Joi.number().integer().min(1).required(),
261-
resourceType: Joi.stringAllowEmpty().allow(null),
262-
rateType: Joi.rateType().allow(null),
263-
workload: Joi.workload().allow(null),
261+
resourceType: Joi.stringAllowEmpty().allow(null).default(null),
262+
rateType: Joi.rateType().allow(null).default(null),
263+
workload: Joi.workload().allow(null).default(null),
264264
skills: Joi.array().items(Joi.string().uuid()).required(),
265-
status: Joi.jobStatus()
265+
status: Joi.jobStatus().default('sourcing')
266266
}).required()
267267
}).required()
268268

src/services/ResourceBookingService.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -194,13 +194,13 @@ fullyUpdateResourceBooking.schema = Joi.object().keys({
194194
data: Joi.object().keys({
195195
projectId: Joi.number().integer().required(),
196196
userId: Joi.string().uuid().required(),
197-
jobId: Joi.string().uuid().allow(null),
198-
startDate: Joi.date().allow(null),
199-
endDate: Joi.date().allow(null),
200-
memberRate: Joi.number().allow(null),
201-
customerRate: Joi.number().allow(null),
197+
jobId: Joi.string().uuid().allow(null).default(null),
198+
startDate: Joi.date().allow(null).default(null),
199+
endDate: Joi.date().allow(null).default(null),
200+
memberRate: Joi.number().allow(null).default(null),
201+
customerRate: Joi.number().allow(null).default(null),
202202
rateType: Joi.rateType().required(),
203-
status: Joi.jobStatus().required()
203+
status: Joi.jobStatus().default('sourcing')
204204
}).required()
205205
}).required()
206206

0 commit comments

Comments
 (0)