Refactor
This commit is contained in:
parent
ddc3c5ba68
commit
174f8022eb
131 changed files with 512 additions and 917 deletions
|
@ -3,7 +3,7 @@ import App from '../../../../../models/app';
|
|||
import AuthSess from '../../../../../models/auth-session';
|
||||
import AccessToken from '../../../../../models/access-token';
|
||||
import { pack } from '../../../../../models/user';
|
||||
import getParams from '../../../get-params';
|
||||
import define from '../../../define';
|
||||
|
||||
export const meta = {
|
||||
requireCredential: false,
|
||||
|
@ -19,10 +19,7 @@ export const meta = {
|
|||
}
|
||||
};
|
||||
|
||||
export default (params: any) => new Promise(async (res, rej) => {
|
||||
const [ps, psErr] = getParams(meta, params);
|
||||
if (psErr) return rej(psErr);
|
||||
|
||||
export default define(meta, (ps) => new Promise(async (res, rej) => {
|
||||
// Lookup app
|
||||
const app = await App.findOne({
|
||||
secret: ps.appSecret
|
||||
|
@ -71,4 +68,4 @@ export default (params: any) => new Promise(async (res, rej) => {
|
|||
detail: true
|
||||
})
|
||||
});
|
||||
});
|
||||
}));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue