feat(!): return 204 instead of useless json responses, add fastFetch

This commit is contained in:
Sam 2023-03-30 16:05:40 +02:00
parent abc78f3a9a
commit 9c8b6a8f91
Signed by: sam
GPG key ID: B4EF20DDE721CAA1
16 changed files with 63 additions and 31 deletions

View file

@ -1,6 +1,6 @@
<script lang="ts">
import type { APIError } from "$lib/api/entities";
import { apiFetchClient } from "$lib/api/fetch";
import { fastFetchClient } from "$lib/api/fetch";
import ErrorAlert from "$lib/components/ErrorAlert.svelte";
import { addToast } from "$lib/toast";
import { Button, FormGroup, Icon, Modal, ModalBody, ModalFooter } from "sveltestrap";
@ -18,7 +18,7 @@
const doReport = async () => {
try {
await apiFetchClient<any>(reportUrl, "POST", { reason: reason });
await fastFetchClient(reportUrl, "POST", { reason: reason });
error = null;
addToast({ header: "Sent report", body: "Successfully sent report!" });
toggle();