feat: add download micro-app for cli
This commit is contained in:
@@ -241,8 +241,15 @@ app
|
||||
key: 'getApp',
|
||||
})
|
||||
.define(async (ctx) => {
|
||||
const { user, key } = ctx.query.data;
|
||||
const app = await AppModel.findOne({ where: { user, key } });
|
||||
const { user, key, id } = ctx.query.data;
|
||||
let app;
|
||||
if (id) {
|
||||
app = await AppModel.findByPk(id);
|
||||
} else if (user && key) {
|
||||
app = await AppModel.findOne({ where: { user, key } });
|
||||
} else {
|
||||
throw new CustomError('user or key is required');
|
||||
}
|
||||
if (!app) {
|
||||
throw new CustomError('app not found');
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user