diff --git a/libs/json-api/json-api-nestjs-sdk/src/lib/service/json-api-sdk.service.ts b/libs/json-api/json-api-nestjs-sdk/src/lib/service/json-api-sdk.service.ts index ee47b9f..a1f4aca 100644 --- a/libs/json-api/json-api-nestjs-sdk/src/lib/service/json-api-sdk.service.ts +++ b/libs/json-api/json-api-nestjs-sdk/src/lib/service/json-api-sdk.service.ts @@ -171,7 +171,7 @@ export class JsonApiSdkService { data: { id: entity[this.jsonApiSdkConfig.idKey].toString(), type: getTypeForReq(entity.constructor.name), - attributes, + ...(Object.keys(attributes).length > 0 ? { attributes } : {}), ...(Object.keys(relationships).length > 0 ? { relationships } : {}), }, };