fix lint
This commit is contained in:
@ -11,7 +11,7 @@ export const meta = {
|
||||
|
||||
limit: {
|
||||
duration: ms('1hour'),
|
||||
max: 30
|
||||
max: 30,
|
||||
},
|
||||
|
||||
params: {
|
||||
@ -26,7 +26,7 @@ export const meta = {
|
||||
res: {
|
||||
type: 'object' as const,
|
||||
optional: false as const, nullable: false as const,
|
||||
}
|
||||
},
|
||||
};
|
||||
|
||||
export default define(meta, async (ps) => {
|
||||
|
@ -20,7 +20,7 @@ export const meta = {
|
||||
|
||||
limit: {
|
||||
duration: ms('1hour'),
|
||||
max: 30
|
||||
max: 30,
|
||||
},
|
||||
|
||||
params: {
|
||||
@ -33,8 +33,8 @@ export const meta = {
|
||||
noSuchObject: {
|
||||
message: 'No such object.',
|
||||
code: 'NO_SUCH_OBJECT',
|
||||
id: 'dc94d745-1262-4e63-a17d-fecaa57efc82'
|
||||
}
|
||||
id: 'dc94d745-1262-4e63-a17d-fecaa57efc82',
|
||||
},
|
||||
},
|
||||
|
||||
res: {
|
||||
@ -44,14 +44,14 @@ export const meta = {
|
||||
type: {
|
||||
type: 'string' as const,
|
||||
optional: false as const, nullable: false as const,
|
||||
enum: ['User', 'Note']
|
||||
enum: ['User', 'Note'],
|
||||
},
|
||||
object: {
|
||||
type: 'object' as const,
|
||||
optional: false as const, nullable: false as const
|
||||
}
|
||||
}
|
||||
}
|
||||
optional: false as const, nullable: false as const,
|
||||
},
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
export default define(meta, async (ps) => {
|
||||
@ -79,7 +79,7 @@ async function fetchAny(uri: string) {
|
||||
if (note) {
|
||||
return {
|
||||
type: 'Note',
|
||||
object: await Notes.pack(note, null, { detail: true })
|
||||
object: await Notes.pack(note, null, { detail: true }),
|
||||
};
|
||||
}
|
||||
} else if (type === 'users') {
|
||||
@ -88,7 +88,7 @@ async function fetchAny(uri: string) {
|
||||
if (user) {
|
||||
return {
|
||||
type: 'User',
|
||||
object: await Users.pack(user, null, { detail: true })
|
||||
object: await Users.pack(user, null, { detail: true }),
|
||||
};
|
||||
}
|
||||
}
|
||||
@ -102,7 +102,7 @@ async function fetchAny(uri: string) {
|
||||
{
|
||||
const [user, note] = await Promise.all([
|
||||
Users.findOne({ uri: uri }),
|
||||
Notes.findOne({ uri: uri })
|
||||
Notes.findOne({ uri: uri }),
|
||||
]);
|
||||
|
||||
const packed = await mergePack(user, note);
|
||||
@ -127,7 +127,7 @@ async function fetchAny(uri: string) {
|
||||
if (note) {
|
||||
return {
|
||||
type: 'Note',
|
||||
object: await Notes.pack(note, null, { detail: true })
|
||||
object: await Notes.pack(note, null, { detail: true }),
|
||||
};
|
||||
}
|
||||
} else if (type === 'users') {
|
||||
@ -136,7 +136,7 @@ async function fetchAny(uri: string) {
|
||||
if (user) {
|
||||
return {
|
||||
type: 'User',
|
||||
object: await Users.pack(user, null, { detail: true })
|
||||
object: await Users.pack(user, null, { detail: true }),
|
||||
};
|
||||
}
|
||||
}
|
||||
@ -144,7 +144,7 @@ async function fetchAny(uri: string) {
|
||||
|
||||
const [user, note] = await Promise.all([
|
||||
Users.findOne({ uri: object.id }),
|
||||
Notes.findOne({ uri: object.id })
|
||||
Notes.findOne({ uri: object.id }),
|
||||
]);
|
||||
|
||||
const packed = await mergePack(user, note);
|
||||
@ -156,7 +156,7 @@ async function fetchAny(uri: string) {
|
||||
const user = await createPerson(getApId(object));
|
||||
return {
|
||||
type: 'User',
|
||||
object: await Users.pack(user, null, { detail: true })
|
||||
object: await Users.pack(user, null, { detail: true }),
|
||||
};
|
||||
}
|
||||
|
||||
@ -164,7 +164,7 @@ async function fetchAny(uri: string) {
|
||||
const note = await createNote(getApId(object), undefined, true);
|
||||
return {
|
||||
type: 'Note',
|
||||
object: await Notes.pack(note!, null, { detail: true })
|
||||
object: await Notes.pack(note!, null, { detail: true }),
|
||||
};
|
||||
}
|
||||
|
||||
@ -175,14 +175,14 @@ async function mergePack(user: User | null | undefined, note: Note | null | unde
|
||||
if (user != null) {
|
||||
return {
|
||||
type: 'User',
|
||||
object: await Users.pack(user, null, { detail: true })
|
||||
object: await Users.pack(user, null, { detail: true }),
|
||||
};
|
||||
}
|
||||
|
||||
if (note != null) {
|
||||
return {
|
||||
type: 'Note',
|
||||
object: await Notes.pack(note, null, { detail: true })
|
||||
object: await Notes.pack(note, null, { detail: true }),
|
||||
};
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user