forked from Telodendria/Telodendria
[FIX] Do some cosmetic changes to the route(see #36)
This commit is contained in:
parent
2d1c51beca
commit
15d0ffb0f4
1 changed files with 5 additions and 17 deletions
|
@ -96,18 +96,12 @@ ROUTE_IMPL(RouteAdminDeactivate, path, argp)
|
|||
|
||||
if (method == HTTP_DELETE)
|
||||
{
|
||||
char * str;
|
||||
UserDeactivateWithInfo(removed, UserGetName(user), reason);
|
||||
response = HashMapCreate();
|
||||
|
||||
str = removedLocalpart;
|
||||
JsonSet(response, JsonValueString(str), 1, "user");
|
||||
|
||||
str = reason;
|
||||
JsonSet(response, JsonValueString(str), 1, "reason");
|
||||
|
||||
str = UserGetName(user);
|
||||
JsonSet(response, JsonValueString(str), 1, "banned_by");
|
||||
JsonSet(response, JsonValueString(removedLocalpart), 1, "user");
|
||||
JsonSet(response, JsonValueString(reason), 1, "reason");
|
||||
JsonSet(response, JsonValueString(UserGetName(user)), 1, "banned_by");
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -116,14 +110,8 @@ ROUTE_IMPL(RouteAdminDeactivate, path, argp)
|
|||
}
|
||||
|
||||
finish:
|
||||
if (user)
|
||||
{
|
||||
UserUnlock(user);
|
||||
}
|
||||
if (removed)
|
||||
{
|
||||
UserUnlock(removed);
|
||||
}
|
||||
UserUnlock(user);
|
||||
UserUnlock(removed);
|
||||
JsonFree(request);
|
||||
return response;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue