This commit is contained in:
syuilo 2018-10-26 08:36:50 +09:00
parent d8a22b9dbc
commit 0f08a5c99a
18 changed files with 18 additions and 18 deletions

View File

@ -62,7 +62,7 @@ export default (endpoint: string, user: IUser, app: IApp, data: any, file?: any)
console.warn(`SLOW API CALL DETECTED: ${ep.name} (${time}ms)`);
}
} catch (e) {
rej(e);
rej(e.message);
return;
}

View File

@ -25,7 +25,7 @@ export const meta = {
export default (params: any) => new Promise(async (res, rej) => {
const [ps, psErr] = getParams(meta, params);
if (psErr) throw psErr;
if (psErr) return rej(psErr);
const stats = await driveChart.getChart(ps.span as any, ps.limit);

View File

@ -25,7 +25,7 @@ export const meta = {
export default (params: any) => new Promise(async (res, rej) => {
const [ps, psErr] = getParams(meta, params);
if (psErr) throw psErr;
if (psErr) return rej(psErr);
const stats = await federationChart.getChart(ps.span as any, ps.limit);

View File

@ -31,7 +31,7 @@ export const meta = {
export default (params: any) => new Promise(async (res, rej) => {
const [ps, psErr] = getParams(meta, params);
if (psErr) throw psErr;
if (psErr) return rej(psErr);
const stats = await hashtagChart.getChart(ps.span as any, ps.limit, ps.tag);

View File

@ -25,7 +25,7 @@ export const meta = {
export default (params: any) => new Promise(async (res, rej) => {
const [ps, psErr] = getParams(meta, params);
if (psErr) throw psErr;
if (psErr) return rej(psErr);
const stats = await networkChart.getChart(ps.span as any, ps.limit);

View File

@ -25,7 +25,7 @@ export const meta = {
export default (params: any) => new Promise(async (res, rej) => {
const [ps, psErr] = getParams(meta, params);
if (psErr) throw psErr;
if (psErr) return rej(psErr);
const stats = await notesChart.getChart(ps.span as any, ps.limit);

View File

@ -33,7 +33,7 @@ export const meta = {
export default (params: any) => new Promise(async (res, rej) => {
const [ps, psErr] = getParams(meta, params);
if (psErr) throw psErr;
if (psErr) return rej(psErr);
const stats = await perUserDriveChart.getChart(ps.span as any, ps.limit, ps.userId);

View File

@ -33,7 +33,7 @@ export const meta = {
export default (params: any) => new Promise(async (res, rej) => {
const [ps, psErr] = getParams(meta, params);
if (psErr) throw psErr;
if (psErr) return rej(psErr);
const stats = await perUserFollowingChart.getChart(ps.span as any, ps.limit, ps.userId);

View File

@ -33,7 +33,7 @@ export const meta = {
export default (params: any) => new Promise(async (res, rej) => {
const [ps, psErr] = getParams(meta, params);
if (psErr) throw psErr;
if (psErr) return rej(psErr);
const stats = await perUserNotesChart.getChart(ps.span as any, ps.limit, ps.userId);

View File

@ -33,7 +33,7 @@ export const meta = {
export default (params: any) => new Promise(async (res, rej) => {
const [ps, psErr] = getParams(meta, params);
if (psErr) throw psErr;
if (psErr) return rej(psErr);
const stats = await perUserReactionsChart.getChart(ps.span as any, ps.limit, ps.userId);

View File

@ -25,7 +25,7 @@ export const meta = {
export default (params: any) => new Promise(async (res, rej) => {
const [ps, psErr] = getParams(meta, params);
if (psErr) throw psErr;
if (psErr) return rej(psErr);
const stats = await usersChart.getChart(ps.span as any, ps.limit);

View File

@ -35,7 +35,7 @@ export const meta = {
export default (params: any) => new Promise(async (res, rej) => {
const [ps, psErr] = getParams(meta, params);
if (psErr) throw psErr;
if (psErr) return rej(psErr);
const hashtags = await Hashtag
.find({

View File

@ -26,7 +26,7 @@ export const meta = {
export default (params: any, user: ILocalUser) => new Promise(async (res, rej) => {
const [ps, psErr] = getParams(meta, params);
if (psErr) throw psErr;
if (psErr) return rej(psErr);
const message = await Message.findOne({
_id: ps.messageId,

View File

@ -56,7 +56,7 @@ export const meta = {
export default (params: any) => new Promise(async (res, rej) => {
const [ps, psErr] = getParams(meta, params);
if (psErr) throw psErr;
if (psErr) return rej(psErr);
// Check if both of sinceId and untilId is specified
if (ps.sinceId && ps.untilId) {

View File

@ -36,7 +36,7 @@ export const meta = {
export default (params: any, user: ILocalUser) => new Promise(async (res, rej) => {
const [ps, psErr] = getParams(meta, params);
if (psErr) throw psErr;
if (psErr) return rej(psErr);
// Check if both of sinceId and untilId is specified
if (ps.sinceId && ps.untilId) {

View File

@ -111,7 +111,7 @@ export const meta = {
export default (params: any, me: ILocalUser) => new Promise(async (res, rej) => {
const [ps, psErr] = getParams(meta, params);
if (psErr) throw psErr;
if (psErr) return rej(psErr);
if (ps.includeUserUsernames != null) {
const ids = erase(null, await Promise.all(ps.includeUserUsernames.map(async (username) => {

View File

@ -32,7 +32,7 @@ export const meta = {
export default (params: any, user: ILocalUser) => new Promise(async (res, rej) => {
const [ps, psErr] = getParams(meta, params);
if (psErr) throw psErr;
if (psErr) return rej(psErr);
// Fetch the list
const userList = await UserList.findOne({

View File

@ -110,7 +110,7 @@ export const meta = {
export default (params: any, me: ILocalUser) => new Promise(async (res, rej) => {
const [ps, psErr] = getParams(meta, params);
if (psErr) throw psErr;
if (psErr) return rej(psErr);
if (ps.userId === undefined && ps.username === undefined) {
return rej('userId or username is required');