Skip to content
This repository has been archived by the owner on Oct 10, 2022. It is now read-only.

Commit

Permalink
Add default context aligned with the default controllers
Browse files Browse the repository at this point in the history
  • Loading branch information
smolijar committed Jan 15, 2019
1 parent a03bed8 commit 987ec84
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/lib/crudella.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { createHandlers } from './service/handlers';
import { createMiddlewareFactory } from './service/middleware';
import { Definitions } from './settings/definitions';

export const createService = <T extends { id: any }, C extends object>(defs: Definitions<T>) => {
export const createService = <T extends { id: any }, C extends object = {}>(defs: Definitions<T>) => {
const implementation = bootstrapConfiguration<T, C>(defs);
const handlers = createHandlers(implementation);
const createMiddleware = createMiddlewareFactory(handlers, implementation.controller);
Expand All @@ -15,7 +15,7 @@ export const createService = <T extends { id: any }, C extends object>(defs: Def
};
};

export const buildService = <T extends { id: any }, C>(
export const buildService = <T extends { id: any }, C = {}>(
buildingDefs: Definitions<T, C>,
prevDefs?: Definitions<T, C>
) => {
Expand Down

0 comments on commit 987ec84

Please sign in to comment.