Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 625e3c4

Browse files
committed
fix: car clientPortal mutations
1 parent e4dfe14 commit 625e3c4

File tree

1 file changed

+4
-2
lines changed
  • packages/plugin-cars-api/src/graphql/resolvers/mutations

1 file changed

+4
-2
lines changed

packages/plugin-cars-api/src/graphql/resolvers/mutations/cars.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -223,10 +223,12 @@ const carMutations = {
223223
mainTypeId: car._id,
224224
relTypes: ['customer', 'company'],
225225
},
226+
isRPC: true,
227+
defaultValue: []
226228
});
227229

228-
if (!relTypeIds.includes(customerId) && !relTypeIds.includes(companyId)) {
229-
throw new Error ('Cant edit this car, not a customer or company car')
230+
if (!relTypeIds?.includes(customerId) && !relTypeIds?.includes(companyId)) {
231+
throw new Error('Cant edit this car, not a customer or company car')
230232
}
231233

232234
const updated = await models.Cars.updateCar(_id, doc);

0 commit comments

Comments
 (0)