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)
|
if (method == HTTP_DELETE)
|
||||||
{
|
{
|
||||||
char * str;
|
|
||||||
UserDeactivateWithInfo(removed, UserGetName(user), reason);
|
UserDeactivateWithInfo(removed, UserGetName(user), reason);
|
||||||
response = HashMapCreate();
|
response = HashMapCreate();
|
||||||
|
|
||||||
str = removedLocalpart;
|
JsonSet(response, JsonValueString(removedLocalpart), 1, "user");
|
||||||
JsonSet(response, JsonValueString(str), 1, "user");
|
JsonSet(response, JsonValueString(reason), 1, "reason");
|
||||||
|
JsonSet(response, JsonValueString(UserGetName(user)), 1, "banned_by");
|
||||||
str = reason;
|
|
||||||
JsonSet(response, JsonValueString(str), 1, "reason");
|
|
||||||
|
|
||||||
str = UserGetName(user);
|
|
||||||
JsonSet(response, JsonValueString(str), 1, "banned_by");
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -116,14 +110,8 @@ ROUTE_IMPL(RouteAdminDeactivate, path, argp)
|
||||||
}
|
}
|
||||||
|
|
||||||
finish:
|
finish:
|
||||||
if (user)
|
|
||||||
{
|
|
||||||
UserUnlock(user);
|
UserUnlock(user);
|
||||||
}
|
|
||||||
if (removed)
|
|
||||||
{
|
|
||||||
UserUnlock(removed);
|
UserUnlock(removed);
|
||||||
}
|
|
||||||
JsonFree(request);
|
JsonFree(request);
|
||||||
return response;
|
return response;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue