mirror of
https://github.com/roleypoly/roleypoly.git
synced 2025-04-24 19:39:11 +00:00
fix: missing tools on a composable handler
This commit is contained in:
parent
76a03c2d2c
commit
d5acea4abb
1 changed files with 55 additions and 52 deletions
|
@ -17,7 +17,7 @@ import {
|
|||
SessionData,
|
||||
UserGuildPermissions,
|
||||
} from '@roleypoly/types';
|
||||
import { AuthType, discordFetch, Handler } from '@roleypoly/worker-utils';
|
||||
import { AuthType, discordFetch, Handler, HandlerTools } from '@roleypoly/worker-utils';
|
||||
import { cacheLayer, CacheLayerOptions, isRoot, withSession } from './api-tools';
|
||||
import { botClientID, botToken } from './config';
|
||||
import { GuildData, Guilds } from './kv';
|
||||
|
@ -229,7 +229,9 @@ export const asEditor = (
|
|||
options: AsEditorOptions = {},
|
||||
wrappedHandler: (session: SessionData, userGuildContext: UserGuildContext) => Handler
|
||||
): Handler =>
|
||||
withSession((session: SessionData) => async (request: Request): Promise<Response> => {
|
||||
withSession(
|
||||
(session: SessionData) =>
|
||||
async (request: Request, tools: HandlerTools): Promise<Response> => {
|
||||
const { rateLimitKey, rateLimitTimeoutSeconds } = options;
|
||||
const url = new URL(request.url);
|
||||
const [, , guildID] = url.pathname.split('/');
|
||||
|
@ -282,5 +284,6 @@ export const asEditor = (
|
|||
guildID,
|
||||
guild,
|
||||
url,
|
||||
})(request);
|
||||
});
|
||||
})(request, tools);
|
||||
}
|
||||
);
|
||||
|
|
Loading…
Add table
Reference in a new issue