Skip to content

Commit 22bf1c2

Browse files
jakesowergr0uch
authored andcommitted
add in forgotten context mutation (#68)
1 parent 775864c commit 22bf1c2

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

lib/index.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -609,13 +609,18 @@ module.exports = Serializer => {
609609
const isArray = recordTypes[originalType][relatedField][keys.isArray]
610610
const isNull = !isArray && payload[reservedKeys.primary] === null
611611

612-
if (isNull)
612+
if (isNull) {
613+
// Rewrite type and IDs.
614+
contextRequest.type = originalType
615+
contextRequest.ids = null
616+
613617
return [{
614618
id: originalIds[0],
615619
replace: {
616620
[relatedField]: null
617621
}
618622
}]
623+
}
619624

620625
if (originalIds.length > 1)
621626
throw new NotFoundError(

0 commit comments

Comments
 (0)