Files
porridger/front/src/api/book/index.ts
2023-08-08 19:26:37 +03:00

17 lines
387 B
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import { API_URL } from '../../config'
import { Book, BookResponse } from './types'
const composeBookURL = () => (
API_URL + '/book?'
)
const processBook = (data: BookResponse): Book => {
if (!data.Success) {
throw new Error('Не удалось забронировать объявление')
}
return data.Success
}
export { composeBookURL, processBook }