17 lines
490 B
TypeScript
17 lines
490 B
TypeScript
import { API_URL } from '../../config'
|
||
import { RemoveAnnouncement, RemoveAnnouncementResponse } from './types'
|
||
|
||
const composeRemoveAnnouncementURL = () => (
|
||
API_URL + '/announcement?'
|
||
)
|
||
|
||
function processRemoveAnnouncement(data: RemoveAnnouncementResponse): RemoveAnnouncement {
|
||
if (!data.Answer) {
|
||
throw new Error('Не удалось закрыть объявление')
|
||
}
|
||
|
||
return data.Answer
|
||
}
|
||
|
||
export { composeRemoveAnnouncementURL, processRemoveAnnouncement }
|