Renamed Answer to Success return fields on front
This commit is contained in:
parent
2b001579c5
commit
18a7a0cbb9
@ -6,7 +6,7 @@ const composePutAnnouncementURL = () => (
|
|||||||
)
|
)
|
||||||
|
|
||||||
const processPutAnnouncement = (data: PutAnnouncementResponse): PutAnnouncement => {
|
const processPutAnnouncement = (data: PutAnnouncementResponse): PutAnnouncement => {
|
||||||
return data.Answer
|
return data.Success
|
||||||
}
|
}
|
||||||
|
|
||||||
export { composePutAnnouncementURL, processPutAnnouncement }
|
export { composePutAnnouncementURL, processPutAnnouncement }
|
||||||
|
@ -1,12 +1,12 @@
|
|||||||
import { isObject } from '../../utils/types'
|
import { isObject } from '../../utils/types'
|
||||||
|
|
||||||
type PutAnnouncementResponse = {
|
type PutAnnouncementResponse = {
|
||||||
Answer: boolean,
|
Success: boolean,
|
||||||
}
|
}
|
||||||
|
|
||||||
const isPutAnnouncementResponse = (obj: unknown): obj is PutAnnouncementResponse => (
|
const isPutAnnouncementResponse = (obj: unknown): obj is PutAnnouncementResponse => (
|
||||||
isObject(obj, {
|
isObject(obj, {
|
||||||
'Answer': 'boolean',
|
'Success': 'boolean',
|
||||||
})
|
})
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -6,11 +6,11 @@ const composeRemoveAnnouncementURL = () => (
|
|||||||
)
|
)
|
||||||
|
|
||||||
function processRemoveAnnouncement(data: RemoveAnnouncementResponse): RemoveAnnouncement {
|
function processRemoveAnnouncement(data: RemoveAnnouncementResponse): RemoveAnnouncement {
|
||||||
if (!data.Answer) {
|
if (!data.Success) {
|
||||||
throw new Error('Не удалось закрыть объявление')
|
throw new Error('Не удалось закрыть объявление')
|
||||||
}
|
}
|
||||||
|
|
||||||
return data.Answer
|
return data.Success
|
||||||
}
|
}
|
||||||
|
|
||||||
export { composeRemoveAnnouncementURL, processRemoveAnnouncement }
|
export { composeRemoveAnnouncementURL, processRemoveAnnouncement }
|
||||||
|
@ -1,12 +1,12 @@
|
|||||||
import { isObject } from '../../utils/types'
|
import { isObject } from '../../utils/types'
|
||||||
|
|
||||||
type RemoveAnnouncementResponse = {
|
type RemoveAnnouncementResponse = {
|
||||||
Answer: boolean,
|
Success: boolean,
|
||||||
}
|
}
|
||||||
|
|
||||||
const isRemoveAnnouncementResponse = (obj: unknown): obj is RemoveAnnouncementResponse => (
|
const isRemoveAnnouncementResponse = (obj: unknown): obj is RemoveAnnouncementResponse => (
|
||||||
isObject(obj, {
|
isObject(obj, {
|
||||||
'Answer': 'boolean',
|
'Success': 'boolean',
|
||||||
})
|
})
|
||||||
)
|
)
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user