This commit is contained in:
syuilo 2018-10-26 08:36:50 +09:00
parent f00489196d
commit 5b1cd3bd3c
No known key found for this signature in database
GPG key ID: BDC4C49D06AB9D69
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');