mirror of
https://git.joinsharkey.org/Sharkey/Sharkey.git
synced 2024-12-28 21:13:08 +02:00
Fix bug
This commit is contained in:
parent
f00489196d
commit
5b1cd3bd3c
18 changed files with 18 additions and 18 deletions
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
@ -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);
|
||||
|
||||
|
|
|
@ -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);
|
||||
|
||||
|
|
|
@ -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);
|
||||
|
||||
|
|
|
@ -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);
|
||||
|
||||
|
|
|
@ -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);
|
||||
|
||||
|
|
|
@ -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);
|
||||
|
||||
|
|
|
@ -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);
|
||||
|
||||
|
|
|
@ -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);
|
||||
|
||||
|
|
|
@ -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);
|
||||
|
||||
|
|
|
@ -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);
|
||||
|
||||
|
|
|
@ -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({
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -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) => {
|
||||
|
|
|
@ -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({
|
||||
|
|
|
@ -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');
|
||||
|
|
Loading…
Reference in a new issue