This commit is contained in:
syuilo
2018-06-18 14:28:43 +09:00
parent 80e5645a84
commit e66d7babc5
56 changed files with 115 additions and 112 deletions

View File

@ -4,11 +4,12 @@
import $ from 'cafy'; import ID from '../../../../../cafy-id';
import { pack } from '../../../../../models/drive-file';
import uploadFromUrl from '../../../../../services/drive/upload-from-url';
import { ILocalUser } from '../../../../../models/user';
/**
* Create a file from a URL
*/
module.exports = async (params, user): Promise<any> => {
module.exports = async (params: any, user: ILocalUser): Promise<any> => {
// Get 'url' parameter
// TODO: Validate this url
const [url, urlErr] = $.str.get(params.url);

View File

@ -1,13 +1,11 @@
/**
* Module dependencies
*/
import $ from 'cafy'; import ID from '../../../../cafy-id';
import DriveFolder, { pack } from '../../../../models/drive-folder';
import { ILocalUser } from '../../../../models/user';
/**
* Get drive folders
*/
module.exports = (params: any, user: ILocalUser, app: IApp) => new Promise(async (res, rej) => {
module.exports = (params: any, user: ILocalUser) => new Promise(async (res, rej) => {
// Get 'limit' parameter
const [limit = 10, limitErr] = $.num.optional().range(1, 100).get(params.limit);
if (limitErr) return rej('invalid limit param');