import {
  BaseApiResponse,
  ErrorApiResponse,
  SuccessApiResponse,
} from '@/types/api/api-general';

export const isResponseSuccess = <T>(
  res?: BaseApiResponse<T>
): res is SuccessApiResponse<T> => {
  return res?.status === 'success';
};

export const isResponseError = <T>(
  res?: BaseApiResponse<T>
): res is ErrorApiResponse => {
  return res?.status === 'error';
};
