remove id before create Listing, set location/companyLocation to null if not set

This commit is contained in:
2024-08-11 13:06:48 +02:00
parent 1e1d5cea57
commit d71a5c25c3
3 changed files with 22 additions and 13 deletions

View File

@@ -176,6 +176,7 @@ export class BusinessListingService {
data.updated = new Date();
const validatedBusinessListing = BusinessListingSchema.parse(data);
const convertedBusinessListing = convertBusinessToDrizzleBusiness(data);
delete convertedBusinessListing.id;
const [createdListing] = await this.conn.insert(businesses).values(convertedBusinessListing).returning();
return convertDrizzleBusinessToBusiness(createdListing);
} catch (error) {