Add v1.0
This commit is contained in:
parent
6a5f642fb4
commit
48dffc112a
21 changed files with 1327 additions and 0 deletions
27
src/endpoints/management/reset_lurkers.ts
Normal file
27
src/endpoints/management/reset_lurkers.ts
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
import { ServerRoute } from "@hapi/hapi";
|
||||
import boom from "@hapi/boom";
|
||||
import { db } from "@/main";
|
||||
import Joi from "joi";
|
||||
|
||||
const data: ServerRoute = {
|
||||
method: `DELETE`, path: `/manage/{channel}/lurkers`,
|
||||
options: {
|
||||
validate: {
|
||||
params: Joi.object({
|
||||
channel: Joi.string().alphanum(),
|
||||
}),
|
||||
},
|
||||
},
|
||||
async handler(request, h) {
|
||||
const { channel } = request.params;
|
||||
|
||||
if (!db[channel]) {
|
||||
throw boom.notFound(`Invalid channel`);
|
||||
};
|
||||
|
||||
db[channel].lurkers = {};
|
||||
|
||||
return h.response().code(200);
|
||||
},
|
||||
};
|
||||
export default data;
|
||||
Loading…
Add table
Add a link
Reference in a new issue