Merge branch 'main' of ssh://85.143.175.152:222/dry_wash_inc/dry-wash-pl
All checks were successful
it-academy/dry-wash-pl/pipeline/head This commit looks good

This commit is contained in:
RustamRu
2025-02-16 11:45:55 +03:00
18 changed files with 16369 additions and 15448 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;
}
};