Skip to content

Commit f54fbcb

Browse files
Fix type check
1 parent c5be109 commit f54fbcb

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

packages/server/src/api/rest/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -723,7 +723,7 @@ class RequestHandler extends APIHandlerBase {
723723
if (parsed.data.relationships) {
724724
for (const [key, data] of Object.entries<any>(parsed.data.relationships)) {
725725
const typeInfo = this.typeMap[key];
726-
if (typeInfo.idFields.length > 1) {
726+
if (typeInfo && typeInfo.idFields.length > 1) {
727727
typeInfo.idFields.forEach((field, index) => {
728728
attributes[field.name] = this.coerce(field.type, data.data.id.split(this.idDivider)[index]);
729729
});
@@ -773,7 +773,7 @@ class RequestHandler extends APIHandlerBase {
773773
// Remove attributes that are present in compound id relationships, as they are not expected by Prisma
774774
for (const [key] of Object.entries<any>(relationships)) {
775775
const typeInfo = this.typeMap[key];
776-
if (typeInfo.idFields.length > 1) {
776+
if (typeInfo && typeInfo.idFields.length > 1) {
777777
typeInfo.idFields.forEach((field) => {
778778
delete attributes[field.name];
779779
});

0 commit comments

Comments
 (0)