Skip to content

Commit

Permalink
Type fix by removing optimistic update of models subscription which i…
Browse files Browse the repository at this point in the history
…s now unnecessary due to redirect to edit model view upon initial upload success
  • Loading branch information
AaronPlave committed Nov 13, 2024
1 parent f5f792c commit a0fb9a8
Showing 1 changed file with 1 addition and 15 deletions.
16 changes: 1 addition & 15 deletions src/utilities/effects.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1096,26 +1096,12 @@ const effects = {
const data = await reqHasura<Model>(gql.CREATE_MODEL, { model: modelInsertInput }, user);
const { createModel } = data;
if (createModel != null) {
const { id, created_at, owner } = createModel;
const model: Omit<ModelSlim, 'view'> = {
created_at,
id,
jar_id,
name,
owner,
plans: [],
refresh_activity_type_logs: [],
refresh_model_parameter_logs: [],
refresh_resource_type_logs: [],
version,
...(description && { description }),
};
const { id } = createModel;

showSuccessToast('Model Created Successfully');
createModelError.set(null);
creatingModel.set(false);

models.updateValue((currentModels: ModelSlim[]) => [...currentModels, model]);
return id;
} else {
throw Error(`Unable to create model "${name}"`);
Expand Down

0 comments on commit a0fb9a8

Please sign in to comment.