mirror of
https://github.com/tiramisulabs/seyfert.git
synced 2025-07-03 21:46:08 +00:00
fix(rest): proxy cumulative routes
This commit is contained in:
parent
dbc5922ffb
commit
0436a4b162
@ -1,3 +1,3 @@
|
|||||||
export * from "./slash/SlashCommand";
|
export * from './slash/SlashCommand';
|
||||||
export * from "./slash/SlashCommandOption";
|
export * from './slash/SlashCommandOption';
|
||||||
export * from "./contextMenu/ContextCommand";
|
export * from './contextMenu/ContextCommand';
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
export * from "./ActionRow";
|
export * from './ActionRow';
|
||||||
export * from "./MessageButton";
|
export * from './MessageButton';
|
||||||
export * from "./SelectMenu";
|
export * from './SelectMenu';
|
||||||
export * from "./TextInput";
|
export * from './TextInput';
|
||||||
export * from "./BaseComponent";
|
export * from './BaseComponent';
|
||||||
|
@ -25,12 +25,10 @@ export class Router {
|
|||||||
if (ArrRequestsMethods.includes(key)) {
|
if (ArrRequestsMethods.includes(key)) {
|
||||||
return (...options: any[]) => this.rest[key](`/${route.join('/')}`, ...options);
|
return (...options: any[]) => this.rest[key](`/${route.join('/')}`, ...options);
|
||||||
}
|
}
|
||||||
route.push(key);
|
return this.createProxy([...route, key]);
|
||||||
return this.createProxy(route);
|
|
||||||
},
|
},
|
||||||
apply: (...[, _, args]) => {
|
apply: (...[, _, args]) => {
|
||||||
route.push(...args.filter((x) => x != null));
|
return this.createProxy([...route, ...args.filter((x) => x != null)]);
|
||||||
return this.createProxy(route);
|
|
||||||
}
|
}
|
||||||
}) as unknown as Routes;
|
}) as unknown as Routes;
|
||||||
}
|
}
|
||||||
@ -48,7 +46,7 @@ export class CDN {
|
|||||||
const lastRoute = `${CDN_URL}/${route.join('/')}`;
|
const lastRoute = `${CDN_URL}/${route.join('/')}`;
|
||||||
if (value) {
|
if (value) {
|
||||||
if (typeof value !== 'string') {
|
if (typeof value !== 'string') {
|
||||||
// rome-ignore lint/style/noParameterAssign: ?!
|
// rome-ignore lint/nursery/noParameterAssign: fix multiples value types
|
||||||
value = String(value);
|
value = String(value);
|
||||||
}
|
}
|
||||||
return `${lastRoute}/${value}`;
|
return `${lastRoute}/${value}`;
|
||||||
@ -56,12 +54,10 @@ export class CDN {
|
|||||||
return lastRoute;
|
return lastRoute;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
route.push(key);
|
return this.createProxy([...route, key]);
|
||||||
return this.createProxy(route);
|
|
||||||
},
|
},
|
||||||
apply: (...[, _, args]) => {
|
apply: (...[, _, args]) => {
|
||||||
route.push(...args.filter((x) => x != null));
|
return this.createProxy([...route, ...args.filter((x) => x != null)]);
|
||||||
return this.createProxy(route);
|
|
||||||
}
|
}
|
||||||
}) as unknown as CDNRoutes;
|
}) as unknown as CDNRoutes;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user