mirror of
https://github.com/NohamR/lanyard-profile-readme.git
synced 2026-05-26 13:41:32 +00:00
fix(fetch): add cache: 'no-store' to avoid errors
This commit is contained in:
@@ -39,9 +39,9 @@ export async function GET(
|
|||||||
|
|
||||||
let getUser: any = {};
|
let getUser: any = {};
|
||||||
|
|
||||||
getUser.data = await fetch(
|
getUser.data = await fetch(`https://api.lanyard.rest/v1/users/${userId}`, {
|
||||||
`https://api.lanyard.rest/v1/users/${userId}`,
|
cache: "no-store",
|
||||||
).then(async (res) => {
|
}).then(async (res) => {
|
||||||
const data = await res.json();
|
const data = await res.json();
|
||||||
|
|
||||||
if (!data.success) {
|
if (!data.success) {
|
||||||
|
|||||||
@@ -9,9 +9,9 @@ export async function getUserCount() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export async function isUserMonitored(userId: string) {
|
export async function isUserMonitored(userId: string) {
|
||||||
const user = await fetch(
|
const user = await fetch(`https://api.lanyard.rest/v1/users/${userId}`, {
|
||||||
`https://api.lanyard.rest/v1/users/${userId}`,
|
cache: "no-store",
|
||||||
).then((res) => res.json());
|
}).then((res) => res.json());
|
||||||
|
|
||||||
return user.success === true;
|
return user.success === true;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,7 +2,9 @@ export const encodeBase64 = async (url: string): Promise<string> => {
|
|||||||
let response = "";
|
let response = "";
|
||||||
|
|
||||||
try {
|
try {
|
||||||
response = await fetch(url)
|
response = await fetch(url, {
|
||||||
|
cache: "no-store",
|
||||||
|
})
|
||||||
.then((res) => res.blob())
|
.then((res) => res.blob())
|
||||||
.then(async (blob) => {
|
.then(async (blob) => {
|
||||||
const buffer = Buffer.from(await blob.arrayBuffer());
|
const buffer = Buffer.from(await blob.arrayBuffer());
|
||||||
|
|||||||
Reference in New Issue
Block a user