From ea18439140425c2e94c3e96bf4feb96ed921b28c Mon Sep 17 00:00:00 2001 From: dm1sh Date: Tue, 8 Aug 2023 18:28:42 +0300 Subject: [PATCH] Added book error indication --- front/src/api/book/index.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/front/src/api/book/index.ts b/front/src/api/book/index.ts index 22fd424..3720de0 100644 --- a/front/src/api/book/index.ts +++ b/front/src/api/book/index.ts @@ -6,6 +6,10 @@ const composeBookURL = () => ( ) const processBook = (data: BookResponse): Book => { + if (!data.Success) { + throw new Error('Не удалось забронировать объявление') + } + return data.Success }