Skip to content

Commit

Permalink
fix(#1314409): error on Boost/Thesaurus creation
Browse files Browse the repository at this point in the history
  • Loading branch information
botisSmile committed Oct 10, 2024
1 parent 9a7a872 commit c0d10d1
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions packages/components/src/hooks/useResource.ts
Original file line number Diff line number Diff line change
Expand Up @@ -96,16 +96,19 @@ export function useResourceOperations<T extends IHydraMember>(
acc.update = update
} else if (
operation['@type'] instanceof Array &&
operation['@type'].length === 2
operation['@type'].length === 2 &&
typeof operation['@type'][1] === 'string'
) {
if (operation['@type'][1] === 'http://schema.org/CreateAction') {
if (
operation['@type'][1].indexOf('//schema.org/CreateAction') !== -1
) {
acc.create = create
} else if (
operation['@type'][1] === 'http://schema.org/ReplaceAction'
operation['@type'][1].indexOf('//schema.org/ReplaceAction') !== -1
) {
acc.replace = replace
} else if (
operation['@type'][1] === 'http://schema.org/DeleteAction'
operation['@type'][1].indexOf('//schema.org/DeleteAction') !== -1
) {
acc.remove = remove
}
Expand Down

0 comments on commit c0d10d1

Please sign in to comment.