Skip to content
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
fix: make schema stricter so that it throws error while adding omitte…
…d fields
  • Loading branch information
Raju-kadel-27 committed Aug 12, 2024
commit 66c9d409055666d9a804f79840945c9dc191fd6d
9 changes: 6 additions & 3 deletions src/server/api/schema/shares.ts
Original file line number Diff line number Diff line change
Expand Up @@ -126,16 +126,19 @@ export const CreateShareSchema = ShareSchema.omit({
createdAt: true,
updatedAt: true,
companyId: true,
}).openapi({
description: "Issue shares to a stakeholder in a company.",
});
})
.strict()
.openapi({
description: "Issue shares to a stakeholder in a company.",
});

export const UpdateShareSchema = ShareSchema.omit({
id: true,
createdAt: true,
updatedAt: true,
})
.partial()
.strict()
.refine(
(data) => {
return Object.values(data).some((value) => value !== undefined);
Expand Down