mirror of
https://github.com/trafficlunar/tomodachi-share.git
synced 2026-05-13 13:17:45 +00:00
fix: api token
This commit is contained in:
parent
dfa1785c84
commit
4cc31ab8b7
1 changed files with 3 additions and 1 deletions
|
|
@ -59,7 +59,9 @@ export async function validateImage(file: File): Promise<{ valid: boolean; error
|
|||
const formData = new FormData();
|
||||
formData.append("image", blob);
|
||||
|
||||
const moderationResponse = await fetch("https://api.trafficlunar.net/moderate/image", { method: "POST", body: formData });
|
||||
const headers = new Headers();
|
||||
headers.append("token", process.env.TOKEN ?? "");
|
||||
const moderationResponse = await fetch("https://api.trafficlunar.net/moderate/image", { method: "POST", body: formData, headers });
|
||||
const result = await moderationResponse.json();
|
||||
if (result.error) {
|
||||
return { valid: false, error: result.error };
|
||||
|
|
|
|||
Loading…
Reference in a new issue