From 907246fd4f6154c013ef7e223d8e351e0ae81ed0 Mon Sep 17 00:00:00 2001 From: Pranav C Date: Sat, 16 Nov 2024 18:00:53 +0000 Subject: [PATCH] fix: expect user object to be null --- packages/nocodb/src/services/calendars.service.ts | 4 ++-- packages/nocodb/src/services/forms.service.ts | 4 ++-- packages/nocodb/src/services/galleries.service.ts | 4 ++-- packages/nocodb/src/services/maps.service.ts | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/packages/nocodb/src/services/calendars.service.ts b/packages/nocodb/src/services/calendars.service.ts index d718a82290..230fb76c16 100644 --- a/packages/nocodb/src/services/calendars.service.ts +++ b/packages/nocodb/src/services/calendars.service.ts @@ -46,8 +46,8 @@ export class CalendarsService { type: ViewTypes.CALENDAR, base_id: model.base_id, source_id: model.source_id, - created_by: param.user.id, - owned_by: param.ownedBy || param.user.id, + created_by: param.user?.id, + owned_by: param.ownedBy || param.user?.id, }, model, ); diff --git a/packages/nocodb/src/services/forms.service.ts b/packages/nocodb/src/services/forms.service.ts index 5f2ebfbb4e..1a2ee585e6 100644 --- a/packages/nocodb/src/services/forms.service.ts +++ b/packages/nocodb/src/services/forms.service.ts @@ -54,8 +54,8 @@ export class FormsService { type: ViewTypes.FORM, base_id: model.base_id, source_id: model.source_id, - created_by: param.user.id, - owned_by: param.ownedBy || param.user.id, + created_by: param.user?.id, + owned_by: param.ownedBy || param.user?.id, }, model, ); diff --git a/packages/nocodb/src/services/galleries.service.ts b/packages/nocodb/src/services/galleries.service.ts index 64df954498..a8d2281f13 100644 --- a/packages/nocodb/src/services/galleries.service.ts +++ b/packages/nocodb/src/services/galleries.service.ts @@ -47,8 +47,8 @@ export class GalleriesService { type: ViewTypes.GALLERY, base_id: model.base_id, source_id: model.source_id, - created_by: param.user.id, - owned_by: param.ownedBy || param.user.id, + created_by: param.user?.id, + owned_by: param.ownedBy || param.user?.id, }, model, ); diff --git a/packages/nocodb/src/services/maps.service.ts b/packages/nocodb/src/services/maps.service.ts index a22afe7c64..4d15b07bd4 100644 --- a/packages/nocodb/src/services/maps.service.ts +++ b/packages/nocodb/src/services/maps.service.ts @@ -42,8 +42,8 @@ export class MapsService { type: ViewTypes.MAP, base_id: model.base_id, source_id: model.source_id, - created_by: param.user.id, - owned_by: param.user.id, + created_by: param.user?.id, + owned_by: param.user?.id, }, model, );