import { toastLogin } from '@kevisual/resources/pages/message/ToastLogin';
import { QueryClient } from '@kevisual/query';

export const query = new QueryClient();

query.afterResponse = async (response) => {
  if (response.code === 401) {
    toastLogin();
    return {
      ...response,
      noMsg: true,
    };
  }
  return response as any;
};
