mirror of
https://git.moonleay.net/Websites/liljudd-website.git
synced 2025-07-25 11:02:04 +02:00
Chore: Update packages
This commit is contained in:
parent
c4251d9f51
commit
18c6535d1c
5 changed files with 1055 additions and 1024 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue