Chore: Update packages

This commit is contained in:
aronmal 2024-02-12 20:20:57 +01:00
parent c4251d9f51
commit 18c6535d1c
Signed by: aronmal
GPG key ID: 816B7707426FC612
5 changed files with 1055 additions and 1024 deletions

View file

@ -26,9 +26,7 @@ const initialValue = () => ({
}[],
});
const getPayload = async (
pathName: string,
): Promise<
const getPayload = async (): Promise<
| { success: false; message: string }
| (ReturnType<typeof initialValue> & { success: true })
> => {
@ -37,6 +35,7 @@ const getPayload = async (
const event = getRequestEvent();
if (!event) return { success: false, message: "No request event!" };
const pathname = new URL(event.request.url).pathname;
const session = await getSession(event.request, authOptions);
if (!session?.user?.id)
return { success: false, message: "No user with id!" };
@ -63,11 +62,7 @@ const getPayload = async (
console.log(error);
return { success: false, message: "Error on discord api request!" };
}
console.log(
pathName,
pathName == event.path ? "server" : "client",
"success",
);
console.log(pathname, "success");
return {
success: true,
@ -85,9 +80,7 @@ function index() {
const [payload] = createResource(
// eslint-disable-next-line solid/reactivity
async () => {
const payload = await getPayload(location.pathname).catch((e) =>
console.warn(e),
);
const payload = await getPayload().catch((e) => console.warn(e));
if (!payload) {
console.error(location.pathname, payload);