mirror of
https://github.com/mauriceboe/TREK.git
synced 2026-10-21 06:26:26 +00:00
refactor(trips): rewrite AccommodationsService.createAccommodation .bind alias
Recipe R4 trap named in the Task 12 brief: a .bind alias of an AssignmentsService/AccommodationsService method is typed any and hides a missing await from tsc and the promise lint rules. createAccommodation belongs to this task's group, so rewritten as an arrow forwarding to the method instead of a bound reference.
This commit is contained in:
@@ -108,10 +108,10 @@ const coversFx = makeStorageFixture('covers/');
|
||||
|
||||
|
||||
let accommodationsSvc: Awaited<ReturnType<typeof makeAccommodationsService>>;
|
||||
let createAccommodation: typeof accommodationsSvc.createAccommodation;
|
||||
let createAccommodation: (...args: Parameters<typeof accommodationsSvc.createAccommodation>) => ReturnType<typeof accommodationsSvc.createAccommodation>;
|
||||
beforeAll(async () => {
|
||||
accommodationsSvc = await makeAccommodationsService(testDb);
|
||||
createAccommodation = accommodationsSvc.createAccommodation.bind(accommodationsSvc);
|
||||
createAccommodation = (...args) => accommodationsSvc.createAccommodation(...args);
|
||||
});
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user