This commit is contained in:
2024-09-30 01:39:07 +08:00
parent 962d89ff29
commit e05c042827
8 changed files with 152 additions and 9 deletions

View File

@@ -6,10 +6,15 @@ app
.route({
path: 'resource',
key: 'list',
middleware: ['auth'],
})
.define(async (ctx) => {
const tokenUser = ctx.state.tokenUser;
const list = await ResourceModel.findAll({
order: [['updatedAt', 'DESC']],
where: {
uid: tokenUser.id,
},
});
ctx.body = list;
return ctx;