From 631c1ce73666525b38aca423295271c9deb0ec35 Mon Sep 17 00:00:00 2001 From: Michael Genson Date: Sat, 28 Mar 2026 16:42:24 +0000 Subject: [PATCH] allow disabling automatic alerts per-request --- frontend/plugins/axios.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/frontend/plugins/axios.ts b/frontend/plugins/axios.ts index 9f3f8ff77..0531a3aca 100644 --- a/frontend/plugins/axios.ts +++ b/frontend/plugins/axios.ts @@ -1,6 +1,12 @@ import axios from "axios"; import { alert } from "~/composables/use-toast"; +declare module "axios" { + interface AxiosRequestConfig { + suppressAlert?: boolean; + } +} + export default defineNuxtPlugin(() => { const tokenName = useRuntimeConfig().public.AUTH_TOKEN; const axiosInstance = axios.create({ @@ -25,7 +31,7 @@ export default defineNuxtPlugin(() => { // Add response interceptor axiosInstance.interceptors.response.use( (response) => { - if (response?.data?.message) alert.info(response.data.message as string); + if (response?.data?.message && !response.config?.suppressAlert) alert.info(response.data.message as string); return response; }, (error) => {