Skip to content

Commit

Permalink
Improve optimistic update of datasetInfo (#398)
Browse files Browse the repository at this point in the history
to reflect all fields from the config.
  • Loading branch information
JosephMarinier authored Jan 27, 2023
1 parent 30e4c6d commit b569ca6
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions webapp/src/services/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -327,11 +327,20 @@ export const api = createApi({
);
const patchDatasetInfo = dispatch(
api.util.updateQueryData("getDatasetInfo", { jobId }, (draft) => {
if (partialConfig.name !== undefined) {
draft.projectName = partialConfig.name;
}
if (partialConfig.model_contract !== undefined) {
draft.modelContract = partialConfig.model_contract;
}
if ("behavioral_testing" in partialConfig) {
draft.perturbationTestingAvailable = Boolean(
partialConfig.behavioral_testing
);
}
if ("pipelines" in partialConfig) {
draft.predictionAvailable = Boolean(partialConfig.pipelines);
}
if ("similarity" in partialConfig) {
draft.similarityAvailable = Boolean(partialConfig.similarity);
}
Expand Down

0 comments on commit b569ca6

Please sign in to comment.