Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Question] Validation when doing partial updates? #180

Open
trevorpfiz opened this issue Mar 28, 2024 · 1 comment
Open

[Question] Validation when doing partial updates? #180

trevorpfiz opened this issue Mar 28, 2024 · 1 comment
Labels
enhancement New feature or request

Comments

@trevorpfiz
Copy link

I noticed that the update mutations expect the full object passed in. Is this because of the optimistic updates? How should we best handle cases where we only want to update part of the schema? Use .partial()?

These are the relevant bits of code I am referring to

export const updateReportSchema = baseSchema;
export const updateReportParams = baseSchema
  .extend({
    patientId: z.coerce.string().min(1),
  })
  .omit({
    userId: true,
  });
export const updateReport = async (
  id: ReportId,
  report: UpdateReportParams,
) => {
@crbon
Copy link

crbon commented Jun 20, 2024

Interested in this also

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants