feat: add get domainApp api

This commit is contained in:
xion 2024-10-07 22:53:15 +08:00
parent 0fc580aa38
commit 3c7ef0d6e4

View File

@ -216,3 +216,21 @@ app
ctx.body = app;
})
.addTo(app);
app
.route({
path: 'app',
key: 'getDomainApp',
})
.define(async (ctx) => {
const { domain } = ctx.query.data;
// const query = {
// }
const app = await AppModel.findOne({ where: { domain } });
if (!app) {
throw new CustomError('app not found');
}
ctx.body = app;
return ctx;
})
.addTo(app);