feat: create default personal calendar on email verification. Refs EventHub/EventHubBack#49

This commit is contained in:
2026-07-20 11:17:31 +03:00
parent 2440c50330
commit 7c1fe1940d
4 changed files with 80 additions and 6 deletions
+6 -1
View File
@@ -19,7 +19,12 @@ init(Req, _Opts) ->
{ok, UserId} ->
core_user:update(UserId, [{status, active}]),
core_verification:delete_token(Token),
handler_utils:send_json(Req1, 200, #{<<"message">> => <<"Account verified">>});
case logic_calendar:ensure_default_calendar(UserId) of
ok ->
handler_utils:send_json(Req1, 200, #{<<"message">> => <<"Account verified">>});
{error, Reason} ->
handler_utils:send_error(Req1, 500, Reason)
end;
{error, expired} ->
handler_utils:send_error(Req1, 410, <<"Token expired">>);
{error, not_found} ->