backend-app-api: disallow required service factory options

Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
This commit is contained in:
Patrik Oldsberg
2023-08-11 17:22:16 +02:00
parent 16b2f13bc6
commit c49785f00c
5 changed files with 16 additions and 154 deletions
@@ -49,10 +49,10 @@ function toInternalServiceFactory<TService, TScope extends 'plugin' | 'root'>(
}
const pluginMetadataServiceFactory = createServiceFactory(
(options: { pluginId: string }) => ({
(options?: { pluginId: string }) => ({
service: coreServices.pluginMetadata,
deps: {},
factory: async () => ({ getId: () => options.pluginId }),
factory: async () => ({ getId: () => options?.pluginId! }),
}),
);