Skip to content
This repository was archived by the owner on Jan 25, 2023. It is now read-only.

Commit 5e49a11

Browse files
committed
add scalar id on 1-1
1 parent 0ce3618 commit 5e49a11

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

src/index.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -550,6 +550,8 @@ export class JSONAPISerializer {
550550

551551
if (value?.id) {
552552
output.id = value.id.toString();
553+
} else if (isString(value) || isNumber(value)) {
554+
output.id = value.toString();
553555
}
554556
serializedRelationships[kebabCase(property)] =
555557
isNull(value) || isUndefined(value) ? null : output;

0 commit comments

Comments
 (0)