Skip to content
This repository has been archived by the owner on Aug 21, 2024. It is now read-only.

Commit

Permalink
Refactor world validators (#10527)
Browse files Browse the repository at this point in the history
Co-authored-by: Hanzla Mateen <[email protected]>
  • Loading branch information
MoizAdnan and hanzlamateen authored Aug 15, 2024
1 parent 68e56c4 commit 374551b
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions packages/server-core/src/world/spawn-point/spawn-point.hooks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,25 +43,22 @@ export default createSkippableHooks(
all: [schemaHooks.resolveExternal(spawnPointExternalResolver), schemaHooks.resolveResult(spawnPointResolver)]
},
before: {
all: [
() => schemaHooks.validateQuery(spawnPointQueryValidator),
schemaHooks.resolveQuery(spawnPointQueryResolver)
],
all: [schemaHooks.validateQuery(spawnPointQueryValidator), schemaHooks.resolveQuery(spawnPointQueryResolver)],
find: [enableClientPagination()],
get: [],
create: [
iff(isProvider('external'), verifyScope('editor', 'write'), projectPermissionAuthenticate(false)),
() => schemaHooks.validateData(spawnPointDataValidator),
schemaHooks.validateData(spawnPointDataValidator),
schemaHooks.resolveData(spawnPointDataResolver)
],
update: [
iff(isProvider('external'), verifyScope('editor', 'write'), projectPermissionAuthenticate(false)),
() => schemaHooks.validateData(spawnPointDataValidator),
schemaHooks.validateData(spawnPointDataValidator),
schemaHooks.resolveData(spawnPointDataResolver)
],
patch: [
iff(isProvider('external'), verifyScope('editor', 'write'), projectPermissionAuthenticate(false)),
() => schemaHooks.validateData(spawnPointDataValidator),
schemaHooks.validateData(spawnPointDataValidator),
schemaHooks.resolveData(spawnPointDataResolver)
],
remove: [iff(isProvider('external'), verifyScope('editor', 'write'), projectPermissionAuthenticate(false))]
Expand Down

0 comments on commit 374551b

Please sign in to comment.