Skip to content

Commit 2c69fc1

Browse files
fix: Allow categoryPlaceId to be nullable in place table and related entities
1 parent 4499e1b commit 2c69fc1

3 files changed

Lines changed: 4 additions & 4 deletions

File tree

scripts.sql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -703,7 +703,7 @@ CREATE TABLE "place" (
703703
"name" VARCHAR(255) NOT NULL,
704704
"coord" JSONB,
705705
"address" TEXT,
706-
"categoryPlaceId" UUID NOT NULL,
706+
"categoryPlaceId" UUID,
707707
"profilephoto" VARCHAR(255),
708708
"ownerId" UUID,
709709
"description" TEXT,

src/slices/place/entities/PlaceEntity.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ export type PlaceData = {
55
active?: boolean;
66
createdAt?: Date;
77
updatedAt?: Date;
8-
categoryPlaceId: string;
8+
categoryPlaceId: string | null;
99
ownerId?: string;
1010
description?: string;
1111
coord?: any;
@@ -26,7 +26,7 @@ export class PlaceEntity {
2626
active?: boolean;
2727
createdAt?: Date;
2828
updatedAt?: Date;
29-
categoryPlaceId: string;
29+
categoryPlaceId: string | null;
3030
ownerId?: string;
3131
description?: string;
3232
coord?: any;

src/slices/user/useCases/completeOwner/CompleteOwner.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ export const completeOwner: CompleteOwnerSignature =
142142
name: ownerData?.name ?? "",
143143
description: "",
144144
active: true,
145-
categoryPlaceId: categoryPlace?._id ?? "",
145+
categoryPlaceId: categoryPlace?._id ?? null,
146146
});
147147
const customerCreated: any = await addCustomer(customer as any);
148148
if (customerCreated?.error === "Há outro cliente com esses dados") {

0 commit comments

Comments
 (0)