Skip to content

Commit

Permalink
Use exhaustive check in syncAssetFolders
Browse files Browse the repository at this point in the history
  • Loading branch information
JiriLojda committed Sep 3, 2024
1 parent 8cc63aa commit a86a0a9
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/modules/sync/sync/assetFolders.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,9 @@ const convertOperation = (operation: PatchOperation): AssetFolderModels.IModifyA
reference: targetCodename ?? throwError(`Missing target codename in ${JSON.stringify(operation)}`),
value: typeof op.value === "string" ? op.value : throwError("Invalid value type"),
}))
.otherwise(op => ({
.with({ op: "remove" }, op => ({
...omit(op, ["oldValue"]),
reference: targetCodename ?? throwError(`Missing target codename in ${JSON.stringify(operation)}`),
}));
}))
.exhaustive();
};

0 comments on commit a86a0a9

Please sign in to comment.