Stage 3.4
This commit is contained in:
@@ -1,18 +1,17 @@
|
||||
-module(logic_calendar).
|
||||
-include("records.hrl").
|
||||
|
||||
-export([create_calendar/3, get_calendar/2, list_calendars/1,
|
||||
-export([create_calendar/4, get_calendar/2, list_calendars/1,
|
||||
update_calendar/3, delete_calendar/2]).
|
||||
-export([can_access/2, can_edit/2]).
|
||||
|
||||
%% Создание календаря
|
||||
create_calendar(UserId, Title, Description) ->
|
||||
% Проверка, что пользователь может создавать календари
|
||||
create_calendar(UserId, Title, Description, Confirmation) ->
|
||||
case core_user:get_by_id(UserId) of
|
||||
{ok, User} ->
|
||||
case User#user.status of
|
||||
active ->
|
||||
core_calendar:create(UserId, Title, Description);
|
||||
core_calendar:create(UserId, Title, Description, Confirmation);
|
||||
_ ->
|
||||
{error, user_inactive}
|
||||
end;
|
||||
|
||||
Reference in New Issue
Block a user