Статистика для дашборда #7
This commit is contained in:
@@ -4,6 +4,7 @@
|
||||
-export([create/2, get_by_id/1, get_by_event_and_user/2, list_by_event/1, list_by_user/1]).
|
||||
-export([update_status/2, delete/1]).
|
||||
-export([generate_id/0]).
|
||||
-export([count_bookings/0]).
|
||||
|
||||
%% Создание бронирования
|
||||
create(EventId, UserId) ->
|
||||
@@ -97,6 +98,8 @@ delete(Id) ->
|
||||
{aborted, Reason} -> {error, Reason}
|
||||
end.
|
||||
|
||||
count_bookings() -> mnesia:table_info(booking, size).
|
||||
|
||||
%% Внутренние функции
|
||||
generate_id() ->
|
||||
base64:encode(crypto:strong_rand_bytes(16), #{mode => urlsafe, padding => false}).
|
||||
Reference in New Issue
Block a user