diff --git a/server/src/services/company-skills.ts b/server/src/services/company-skills.ts index c6da9f8bb86..0c4f5df645d 100644 --- a/server/src/services/company-skills.ts +++ b/server/src/services/company-skills.ts @@ -6143,6 +6143,8 @@ export function companySkillService(db: Db, options: { actor?: AuthorizationActo companyId: string, options: RuntimeSkillEntryOptions = {}, ): Promise { + if (options.onlyKeys?.size === 0 || (!options.onlyKeys && options.selectionConfig && !options.includeLegacy + && readPaperclipSkillSyncPreference(options.selectionConfig).desiredSkills.length === 0)) return []; const skills = await listFull(companyId); const selectedKeys = options.onlyKeys ?? (options.selectionConfig ? new Set( (options.includeLegacy ? resolveLegacyPaperclipDesiredSkillNames : resolvePaperclipDesiredSkillNames)(