From 374551b1fad3325715d343291ac8eed98aebf646 Mon Sep 17 00:00:00 2001 From: Moiz Adnan <67912355+MoizAdnan@users.noreply.github.com> Date: Thu, 15 Aug 2024 17:14:36 +0500 Subject: [PATCH] Refactor world validators (#10527) Co-authored-by: Hanzla Mateen --- .../src/world/spawn-point/spawn-point.hooks.ts | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/packages/server-core/src/world/spawn-point/spawn-point.hooks.ts b/packages/server-core/src/world/spawn-point/spawn-point.hooks.ts index 18a6200c58..837edb9d43 100644 --- a/packages/server-core/src/world/spawn-point/spawn-point.hooks.ts +++ b/packages/server-core/src/world/spawn-point/spawn-point.hooks.ts @@ -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))]