Merge branch 'feat/inda-383-daily-stat' into 'main'
[ProtonMail-WebClient.git] / packages / drive-store / utils / isErrorDueToNameConflict.ts
blob4174ad963dfc321db2cf5d8fa1720d19fc6d78da
1 import { API_CUSTOM_ERROR_CODES, HTTP_ERROR_CODES } from '@proton/shared/lib/errors';
3 export const isErrorDueToNameConflict = (err: any): boolean =>
4     typeof err === 'object' &&
5     err.status === HTTP_ERROR_CODES.UNPROCESSABLE_ENTITY &&
6     err.data?.Code === API_CUSTOM_ERROR_CODES.ALREADY_EXISTS;