This repository was archived by the owner on Mar 13, 2025. It is now read-only.
File tree 2 files changed +29
-28
lines changed
2 files changed +29
-28
lines changed Original file line number Diff line number Diff line change @@ -59,22 +59,22 @@ const JobForm = ({ teamId, jobId }) => {
59
59
}
60
60
} ;
61
61
62
- const getRequestData = ( values ) => {
63
- return {
64
- projectId : values . projectId ,
65
- externalId : values . externalId ,
66
- description : values . description ,
67
- title : values . title ,
68
- startDate : values . startDate ,
69
- duration : values . duration ,
70
- numPositions : values . numPositions ,
71
- resourceType : values . resourceType ,
72
- rateType : values . rateType ,
73
- workload : values . workload ,
74
- skills : values . skills ,
75
- status : values . status ,
76
- } ;
77
- } ;
62
+ // as we are using `PUT` method (not `PATCH`) we have send ALL the fields
63
+ // fields which we don't send would become `null` otherwise
64
+ const getRequestData = ( values ) => _ . pick ( values , [
65
+ 'projectId' ,
66
+ 'externalId' ,
67
+ 'description' ,
68
+ 'title' ,
69
+ 'startDate' ,
70
+ 'duration' ,
71
+ 'numPositions' ,
72
+ 'resourceType' ,
73
+ 'rateType' ,
74
+ 'workload' ,
75
+ 'skills' ,
76
+ 'status' ,
77
+ ] ) ;
78
78
79
79
useEffect ( ( ) => {
80
80
if ( skills && job && ! options ) {
Original file line number Diff line number Diff line change @@ -67,18 +67,19 @@ const ResourceBookingDetails = ({ teamId, resourceBookingId }) => {
67
67
) ;
68
68
} ;
69
69
70
- const getRequestData = ( values ) => {
71
- return {
72
- projectId : values . projectId ,
73
- startDate : values . startDate ,
74
- endDate : values . endDate ,
75
- memberRate : values . memberRate ,
76
- customerRate : values . customerRate ,
77
- status : values . status ,
78
- userId : values . userId ,
79
- rateType : values . rateType ,
80
- } ;
81
- } ;
70
+ // as we are using `PUT` method (not `PATCH`) we have send ALL the fields
71
+ // fields which we don't send would become `null` otherwise
72
+ const getRequestData = ( values ) => _ . pick ( values , [
73
+ 'projectId' ,
74
+ 'userId' ,
75
+ 'jobId' ,
76
+ 'status' ,
77
+ 'startDate' ,
78
+ 'endDate' ,
79
+ 'memberRate' ,
80
+ 'customerRate' ,
81
+ 'rateType' ,
82
+ ] ) ;
82
83
83
84
return (
84
85
< Page title = "Edit Member Details" >
You can’t perform that action at this time.
0 commit comments