Add: clear
This commit is contained in:
@@ -2,10 +2,11 @@ import {
|
||||
deleteTimeRange,
|
||||
getLimit,
|
||||
authenticate,
|
||||
updateUsername,
|
||||
updateUsernameWithLimit,
|
||||
} from "../../../../libs/db";
|
||||
|
||||
import { addAPIQPS } from '../../../../libs/stats';
|
||||
import { addAPIQPS } from "../../../../libs/stats";
|
||||
|
||||
export default function handler(req, res) {
|
||||
addAPIQPS();
|
||||
@@ -43,6 +44,16 @@ export default function handler(req, res) {
|
||||
return;
|
||||
}
|
||||
|
||||
// admin update username
|
||||
const { token } = req.body;
|
||||
if (authenticate(token)) {
|
||||
updateUsername.run(username, id);
|
||||
res.status(200).json({
|
||||
success: true,
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
try {
|
||||
const limit = getLimit();
|
||||
updateUsernameWithLimit(username, id, limit);
|
||||
|
||||
Reference in New Issue
Block a user