fix(api): resolve public calendar GET by unique short_name.
This commit is contained in:
@@ -121,7 +121,8 @@ get_calendar(Req) ->
|
||||
case logic_calendar:get_calendar(UserId, CalendarId) of
|
||||
{ok, Calendar} ->
|
||||
Json0 = handler_utils:calendar_to_json(Calendar),
|
||||
Following = UserId =/= <<>> andalso logic_calendar_follow:is_following(UserId, CalendarId),
|
||||
Following = UserId =/= <<>> andalso
|
||||
logic_calendar_follow:is_following(UserId, Calendar#calendar.id),
|
||||
handler_utils:send_json(Req1, 200, Json0#{following => Following});
|
||||
{error, access_denied} ->
|
||||
handler_utils:send_error(Req1, 403, <<"Access denied">>);
|
||||
|
||||
Reference in New Issue
Block a user