wip
This commit is contained in:
@@ -7,7 +7,7 @@ import { ILocalUser } from '../../../../../models/user';
|
||||
/**
|
||||
* Create a file
|
||||
*/
|
||||
module.exports = async (file: any, params: any, user: ILocalUser): Promise<any> => {
|
||||
export default async (file: any, params: any, user: ILocalUser): Promise<any> => {
|
||||
if (file == null) {
|
||||
throw 'file is required';
|
||||
}
|
||||
|
@@ -7,7 +7,7 @@ import { ILocalUser } from '../../../../../models/user';
|
||||
/**
|
||||
* Delete a file
|
||||
*/
|
||||
module.exports = async (params: any, user: ILocalUser) => {
|
||||
export default async (params: any, user: ILocalUser) => {
|
||||
// Get 'fileId' parameter
|
||||
const [fileId, fileIdErr] = $.type(ID).get(params.fileId);
|
||||
if (fileIdErr) throw 'invalid fileId param';
|
||||
|
@@ -5,7 +5,7 @@ import { ILocalUser } from '../../../../../models/user';
|
||||
/**
|
||||
* Find a file(s)
|
||||
*/
|
||||
module.exports = (params: any, user: ILocalUser) => new Promise(async (res, rej) => {
|
||||
export default (params: any, user: ILocalUser) => new Promise(async (res, rej) => {
|
||||
// Get 'name' parameter
|
||||
const [name, nameErr] = $.str.get(params.name);
|
||||
if (nameErr) return rej('invalid name param');
|
||||
|
@@ -5,7 +5,7 @@ import { ILocalUser } from '../../../../../models/user';
|
||||
/**
|
||||
* Show a file
|
||||
*/
|
||||
module.exports = async (params: any, user: ILocalUser) => {
|
||||
export default async (params: any, user: ILocalUser) => {
|
||||
// Get 'fileId' parameter
|
||||
const [fileId, fileIdErr] = $.type(ID).get(params.fileId);
|
||||
if (fileIdErr) throw 'invalid fileId param';
|
||||
|
@@ -7,7 +7,7 @@ import { ILocalUser } from '../../../../../models/user';
|
||||
/**
|
||||
* Update a file
|
||||
*/
|
||||
module.exports = (params: any, user: ILocalUser) => new Promise(async (res, rej) => {
|
||||
export default (params: any, user: ILocalUser) => new Promise(async (res, rej) => {
|
||||
// Get 'fileId' parameter
|
||||
const [fileId, fileIdErr] = $.type(ID).get(params.fileId);
|
||||
if (fileIdErr) return rej('invalid fileId param');
|
||||
|
@@ -9,7 +9,7 @@ import { ILocalUser } from '../../../../../models/user';
|
||||
/**
|
||||
* Create a file from a URL
|
||||
*/
|
||||
module.exports = async (params: any, user: ILocalUser): Promise<any> => {
|
||||
export default async (params: any, user: ILocalUser): Promise<any> => {
|
||||
// Get 'url' parameter
|
||||
// TODO: Validate this url
|
||||
const [url, urlErr] = $.str.get(params.url);
|
||||
|
Reference in New Issue
Block a user