feat: add master test
All checks were successful
it-academy/dry-wash-pl/pipeline/pr-main This commit looks good
it-academy/dry-wash-pl/pipeline/head This commit looks good

This commit is contained in:
2025-02-16 11:31:26 +03:00
parent 56f65fbd3a
commit a616d3815b
5 changed files with 115 additions and 178 deletions

View File

@@ -1,6 +1,6 @@
import { FetchBaseQueryError } from "@reduxjs/toolkit/query";
import { FetchBaseQueryError } from '@reduxjs/toolkit/query';
import { BaseResponse } from "../../models/api";
import { BaseResponse } from '../../models/api';
export const extractBodyFromResponse = <Body>(response: BaseResponse<Body>) => {
if (response.success) {
@@ -8,8 +8,14 @@ export const extractBodyFromResponse = <Body>(response: BaseResponse<Body>) => {
}
};
export const extractErrorMessageFromResponse = ({ data }: FetchBaseQueryError) => {
if (typeof data === 'object' && 'message' in data && typeof data.message === 'string') {
export const extractErrorMessageFromResponse = ({
data,
}: FetchBaseQueryError) => {
if (
typeof data === 'object' &&
'message' in data &&
typeof data.message === 'string'
) {
return data.message;
}
};