mirror of
https://git.joinsharkey.org/Sharkey/Sharkey.git
synced 2024-12-02 20: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)`);
|
console.warn(`SLOW API CALL DETECTED: ${ep.name} (${time}ms)`);
|
||||||
}
|
}
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
rej(e);
|
rej(e.message);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -25,7 +25,7 @@ export const meta = {
|
||||||
|
|
||||||
export default (params: any) => new Promise(async (res, rej) => {
|
export default (params: any) => new Promise(async (res, rej) => {
|
||||||
const [ps, psErr] = getParams(meta, params);
|
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);
|
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) => {
|
export default (params: any) => new Promise(async (res, rej) => {
|
||||||
const [ps, psErr] = getParams(meta, params);
|
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);
|
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) => {
|
export default (params: any) => new Promise(async (res, rej) => {
|
||||||
const [ps, psErr] = getParams(meta, params);
|
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);
|
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) => {
|
export default (params: any) => new Promise(async (res, rej) => {
|
||||||
const [ps, psErr] = getParams(meta, params);
|
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);
|
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) => {
|
export default (params: any) => new Promise(async (res, rej) => {
|
||||||
const [ps, psErr] = getParams(meta, params);
|
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);
|
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) => {
|
export default (params: any) => new Promise(async (res, rej) => {
|
||||||
const [ps, psErr] = getParams(meta, params);
|
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);
|
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) => {
|
export default (params: any) => new Promise(async (res, rej) => {
|
||||||
const [ps, psErr] = getParams(meta, params);
|
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);
|
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) => {
|
export default (params: any) => new Promise(async (res, rej) => {
|
||||||
const [ps, psErr] = getParams(meta, params);
|
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);
|
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) => {
|
export default (params: any) => new Promise(async (res, rej) => {
|
||||||
const [ps, psErr] = getParams(meta, params);
|
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);
|
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) => {
|
export default (params: any) => new Promise(async (res, rej) => {
|
||||||
const [ps, psErr] = getParams(meta, params);
|
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);
|
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) => {
|
export default (params: any) => new Promise(async (res, rej) => {
|
||||||
const [ps, psErr] = getParams(meta, params);
|
const [ps, psErr] = getParams(meta, params);
|
||||||
if (psErr) throw psErr;
|
if (psErr) return rej(psErr);
|
||||||
|
|
||||||
const hashtags = await Hashtag
|
const hashtags = await Hashtag
|
||||||
.find({
|
.find({
|
||||||
|
|
|
@ -26,7 +26,7 @@ export const meta = {
|
||||||
|
|
||||||
export default (params: any, user: ILocalUser) => new Promise(async (res, rej) => {
|
export default (params: any, user: ILocalUser) => new Promise(async (res, rej) => {
|
||||||
const [ps, psErr] = getParams(meta, params);
|
const [ps, psErr] = getParams(meta, params);
|
||||||
if (psErr) throw psErr;
|
if (psErr) return rej(psErr);
|
||||||
|
|
||||||
const message = await Message.findOne({
|
const message = await Message.findOne({
|
||||||
_id: ps.messageId,
|
_id: ps.messageId,
|
||||||
|
|
|
@ -56,7 +56,7 @@ export const meta = {
|
||||||
|
|
||||||
export default (params: any) => new Promise(async (res, rej) => {
|
export default (params: any) => new Promise(async (res, rej) => {
|
||||||
const [ps, psErr] = getParams(meta, params);
|
const [ps, psErr] = getParams(meta, params);
|
||||||
if (psErr) throw psErr;
|
if (psErr) return rej(psErr);
|
||||||
|
|
||||||
// Check if both of sinceId and untilId is specified
|
// Check if both of sinceId and untilId is specified
|
||||||
if (ps.sinceId && ps.untilId) {
|
if (ps.sinceId && ps.untilId) {
|
||||||
|
|
|
@ -36,7 +36,7 @@ export const meta = {
|
||||||
|
|
||||||
export default (params: any, user: ILocalUser) => new Promise(async (res, rej) => {
|
export default (params: any, user: ILocalUser) => new Promise(async (res, rej) => {
|
||||||
const [ps, psErr] = getParams(meta, params);
|
const [ps, psErr] = getParams(meta, params);
|
||||||
if (psErr) throw psErr;
|
if (psErr) return rej(psErr);
|
||||||
|
|
||||||
// Check if both of sinceId and untilId is specified
|
// Check if both of sinceId and untilId is specified
|
||||||
if (ps.sinceId && ps.untilId) {
|
if (ps.sinceId && ps.untilId) {
|
||||||
|
|
|
@ -111,7 +111,7 @@ export const meta = {
|
||||||
|
|
||||||
export default (params: any, me: ILocalUser) => new Promise(async (res, rej) => {
|
export default (params: any, me: ILocalUser) => new Promise(async (res, rej) => {
|
||||||
const [ps, psErr] = getParams(meta, params);
|
const [ps, psErr] = getParams(meta, params);
|
||||||
if (psErr) throw psErr;
|
if (psErr) return rej(psErr);
|
||||||
|
|
||||||
if (ps.includeUserUsernames != null) {
|
if (ps.includeUserUsernames != null) {
|
||||||
const ids = erase(null, await Promise.all(ps.includeUserUsernames.map(async (username) => {
|
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) => {
|
export default (params: any, user: ILocalUser) => new Promise(async (res, rej) => {
|
||||||
const [ps, psErr] = getParams(meta, params);
|
const [ps, psErr] = getParams(meta, params);
|
||||||
if (psErr) throw psErr;
|
if (psErr) return rej(psErr);
|
||||||
|
|
||||||
// Fetch the list
|
// Fetch the list
|
||||||
const userList = await UserList.findOne({
|
const userList = await UserList.findOne({
|
||||||
|
|
|
@ -110,7 +110,7 @@ export const meta = {
|
||||||
|
|
||||||
export default (params: any, me: ILocalUser) => new Promise(async (res, rej) => {
|
export default (params: any, me: ILocalUser) => new Promise(async (res, rej) => {
|
||||||
const [ps, psErr] = getParams(meta, params);
|
const [ps, psErr] = getParams(meta, params);
|
||||||
if (psErr) throw psErr;
|
if (psErr) return rej(psErr);
|
||||||
|
|
||||||
if (ps.userId === undefined && ps.username === undefined) {
|
if (ps.userId === undefined && ps.username === undefined) {
|
||||||
return rej('userId or username is required');
|
return rej('userId or username is required');
|
||||||
|
|
Loading…
Reference in a new issue