config
This commit is contained in:
21
src/routes/config/list.ts
Normal file
21
src/routes/config/list.ts
Normal file
@@ -0,0 +1,21 @@
|
||||
import { app } from '@/app.ts';
|
||||
import { ConfigModel } from './models/model.ts';
|
||||
app
|
||||
.route({
|
||||
path: 'config',
|
||||
key: 'list',
|
||||
middleware: ['auth'],
|
||||
})
|
||||
.define(async (ctx) => {
|
||||
const { id } = ctx.state.tokenUser;
|
||||
const config = await ConfigModel.findAll({
|
||||
where: {
|
||||
uid: id,
|
||||
},
|
||||
});
|
||||
ctx.body = {
|
||||
list: config,
|
||||
};
|
||||
})
|
||||
.addTo(app);
|
||||
|
||||
Reference in New Issue
Block a user