Skip to content

Commit

Permalink
be a bit more permissive on saving
Browse files Browse the repository at this point in the history
  • Loading branch information
Sebastian Tilsch committed Apr 3, 2024
1 parent 6e0f6a9 commit 5b5b349
Showing 1 changed file with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,9 @@ export const useCRUDWithQueryClient = (
const removeMutation = useMutation(
["remove", entityIRI],
async () => {
if (!entityIRI || !ready)
if (!entityIRI || !ready) {
throw new Error("entityIRI or updateFetch is not defined");
}
const typeName = dataStore.typeIRItoTypeName(typeIRI);
return await dataStore.removeDocument(typeName, entityIRI);
},
Expand All @@ -79,9 +80,11 @@ export const useCRUDWithQueryClient = (
async (data: Record<string, any>) => {
if (!Boolean(allowUnsafeSourceIRIs)) {
if (!entityIRI || !typeIRI || !ready)
throw new Error(
console.warn("entryIRI or typeIRI not defined, will continue anyway");
console.log({ entityIRI, typeIRI, ready, data });
/*throw new Error(
"entityIRI or typeIRI or updateFetch is not defined",
);
);*/
}
const dataWithId: NamedAndTypedEntity = {
...data,
Expand Down

0 comments on commit 5b5b349

Please sign in to comment.