Replace string type with generic in withSaleorEventMatch middleware
This commit is contained in:
parent
c6307a8c1b
commit
0d93b14e16
1 changed files with 1 additions and 1 deletions
|
@ -31,7 +31,7 @@ export const withSaleorDomainPresent: Middleware =
|
||||||
};
|
};
|
||||||
|
|
||||||
export const withSaleorEventMatch =
|
export const withSaleorEventMatch =
|
||||||
(expectedEvent: string): Middleware =>
|
<E extends string>(expectedEvent: `${Lowercase<E>}`): Middleware =>
|
||||||
(handler) =>
|
(handler) =>
|
||||||
async (request) => {
|
async (request) => {
|
||||||
const receivedEvent = request.headers[SALEOR_EVENT_HEADER];
|
const receivedEvent = request.headers[SALEOR_EVENT_HEADER];
|
||||||
|
|
Loading…
Reference in a new issue