lots of changes with docker
All checks were successful
Build and Push LST Docker Image / docker (push) Successful in 2m57s
All checks were successful
Build and Push LST Docker Image / docker (push) Successful in 2m57s
This commit is contained in:
24
frontend/src/lib/queries/notificationSubs.ts
Normal file
24
frontend/src/lib/queries/notificationSubs.ts
Normal file
@@ -0,0 +1,24 @@
|
||||
import { keepPreviousData, queryOptions } from "@tanstack/react-query";
|
||||
import axios from "axios";
|
||||
|
||||
export function notificationSubs(userId?: string) {
|
||||
return queryOptions({
|
||||
queryKey: ["notificationSubs"],
|
||||
queryFn: () => fetch(userId),
|
||||
staleTime: 5000,
|
||||
refetchOnWindowFocus: true,
|
||||
placeholderData: keepPreviousData,
|
||||
});
|
||||
}
|
||||
|
||||
const fetch = async (userId?: string) => {
|
||||
if (window.location.hostname === "localhost") {
|
||||
await new Promise((res) => setTimeout(res, 5000));
|
||||
}
|
||||
|
||||
const { data } = await axios.get(
|
||||
`/lst/api/notification/sub${userId ? `?userId=${userId}` : ""}`,
|
||||
);
|
||||
|
||||
return data.data;
|
||||
};
|
||||
Reference in New Issue
Block a user