diff --git a/front/src/api/putAnnouncement/index.ts b/front/src/api/putAnnouncement/index.ts index 0cc2cb4..c4de6e9 100644 --- a/front/src/api/putAnnouncement/index.ts +++ b/front/src/api/putAnnouncement/index.ts @@ -6,7 +6,7 @@ const composePutAnnouncementURL = () => ( ) const processPutAnnouncement = (data: PutAnnouncementResponse): PutAnnouncement => { - return data.Answer + return data.Success } export { composePutAnnouncementURL, processPutAnnouncement } diff --git a/front/src/api/putAnnouncement/types.ts b/front/src/api/putAnnouncement/types.ts index 9339351..dc2b676 100644 --- a/front/src/api/putAnnouncement/types.ts +++ b/front/src/api/putAnnouncement/types.ts @@ -1,12 +1,12 @@ import { isObject } from '../../utils/types' type PutAnnouncementResponse = { - Answer: boolean, + Success: boolean, } const isPutAnnouncementResponse = (obj: unknown): obj is PutAnnouncementResponse => ( isObject(obj, { - 'Answer': 'boolean', + 'Success': 'boolean', }) ) diff --git a/front/src/api/removeAnnouncement/index.ts b/front/src/api/removeAnnouncement/index.ts index dd52f7a..0aee986 100644 --- a/front/src/api/removeAnnouncement/index.ts +++ b/front/src/api/removeAnnouncement/index.ts @@ -6,11 +6,11 @@ const composeRemoveAnnouncementURL = () => ( ) function processRemoveAnnouncement(data: RemoveAnnouncementResponse): RemoveAnnouncement { - if (!data.Answer) { + if (!data.Success) { throw new Error('Не удалось закрыть объявление') } - return data.Answer + return data.Success } export { composeRemoveAnnouncementURL, processRemoveAnnouncement } diff --git a/front/src/api/removeAnnouncement/types.ts b/front/src/api/removeAnnouncement/types.ts index 016379a..4a02fd8 100644 --- a/front/src/api/removeAnnouncement/types.ts +++ b/front/src/api/removeAnnouncement/types.ts @@ -1,12 +1,12 @@ import { isObject } from '../../utils/types' type RemoveAnnouncementResponse = { - Answer: boolean, + Success: boolean, } const isRemoveAnnouncementResponse = (obj: unknown): obj is RemoveAnnouncementResponse => ( isObject(obj, { - 'Answer': 'boolean', + 'Success': 'boolean', }) )