Refactorng
This commit is contained in:
parent
865fd25af1
commit
aa4ef6745a
132 changed files with 180 additions and 212 deletions
|
|
@ -1,6 +1,6 @@
|
|||
import $ from 'cafy';
|
||||
import User, { ILocalUser } from '../../../../models/user';
|
||||
import event from '../../../../publishers/stream';
|
||||
import event from '../../../../stream';
|
||||
|
||||
export default async (params: any, user: ILocalUser) => new Promise(async (res, rej) => {
|
||||
// Get 'id' parameter
|
||||
|
|
@ -8,7 +8,7 @@ export default async (params: any, user: ILocalUser) => new Promise(async (res,
|
|||
if (idErr) return rej('invalid id param');
|
||||
|
||||
// Get 'data' parameter
|
||||
const [data, dataErr] = $.obj.get(params.data);
|
||||
const [data, dataErr] = $.obj().get(params.data);
|
||||
if (dataErr) return rej('invalid data param');
|
||||
|
||||
if (id == null && data == null) return rej('you need to set id and data params if home param unset');
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue