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? #8

Open
OmegaHawkeye opened this issue Apr 30, 2024 · 0 comments
Open

[Question] Validation when doing partial updates? #8

OmegaHawkeye opened this issue Apr 30, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@OmegaHawkeye
Copy link
Owner

From kirimase created by trevorpfiz: nicoalbanese#180

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,
) => {
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
Development

No branches or pull requests

1 participant