fix lint
This commit is contained in:
@@ -27,27 +27,27 @@ export const meta = {
|
||||
noSuchClip: {
|
||||
message: 'No such clip.',
|
||||
code: 'NO_SUCH_CLIP',
|
||||
id: 'd6e76cc0-a1b5-4c7c-a287-73fa9c716dcf'
|
||||
id: 'd6e76cc0-a1b5-4c7c-a287-73fa9c716dcf',
|
||||
},
|
||||
|
||||
noSuchNote: {
|
||||
message: 'No such note.',
|
||||
code: 'NO_SUCH_NOTE',
|
||||
id: 'fc8c0b49-c7a3-4664-a0a6-b418d386bb8b'
|
||||
id: 'fc8c0b49-c7a3-4664-a0a6-b418d386bb8b',
|
||||
},
|
||||
|
||||
alreadyClipped: {
|
||||
message: 'The note has already been clipped.',
|
||||
code: 'ALREADY_CLIPPED',
|
||||
id: '734806c4-542c-463a-9311-15c512803965'
|
||||
id: '734806c4-542c-463a-9311-15c512803965',
|
||||
},
|
||||
}
|
||||
},
|
||||
};
|
||||
|
||||
export default define(meta, async (ps, user) => {
|
||||
const clip = await Clips.findOne({
|
||||
id: ps.clipId,
|
||||
userId: user.id
|
||||
userId: user.id,
|
||||
});
|
||||
|
||||
if (clip == null) {
|
||||
@@ -61,7 +61,7 @@ export default define(meta, async (ps, user) => {
|
||||
|
||||
const exist = await ClipNotes.findOne({
|
||||
noteId: note.id,
|
||||
clipId: clip.id
|
||||
clipId: clip.id,
|
||||
});
|
||||
|
||||
if (exist != null) {
|
||||
@@ -71,6 +71,6 @@ export default define(meta, async (ps, user) => {
|
||||
await ClipNotes.insert({
|
||||
id: genId(),
|
||||
noteId: note.id,
|
||||
clipId: clip.id
|
||||
clipId: clip.id,
|
||||
});
|
||||
});
|
||||
|
||||
@@ -12,23 +12,23 @@ export const meta = {
|
||||
|
||||
params: {
|
||||
name: {
|
||||
validator: $.str.range(1, 100)
|
||||
validator: $.str.range(1, 100),
|
||||
},
|
||||
|
||||
isPublic: {
|
||||
validator: $.optional.bool
|
||||
validator: $.optional.bool,
|
||||
},
|
||||
|
||||
description: {
|
||||
validator: $.optional.nullable.str.range(1, 2048)
|
||||
}
|
||||
validator: $.optional.nullable.str.range(1, 2048),
|
||||
},
|
||||
},
|
||||
|
||||
res: {
|
||||
type: 'object' as const,
|
||||
optional: false as const, nullable: false as const,
|
||||
ref: 'Clip'
|
||||
}
|
||||
ref: 'Clip',
|
||||
},
|
||||
};
|
||||
|
||||
export default define(meta, async (ps, user) => {
|
||||
|
||||
@@ -14,22 +14,22 @@ export const meta = {
|
||||
params: {
|
||||
clipId: {
|
||||
validator: $.type(ID),
|
||||
}
|
||||
},
|
||||
},
|
||||
|
||||
errors: {
|
||||
noSuchClip: {
|
||||
message: 'No such clip.',
|
||||
code: 'NO_SUCH_CLIP',
|
||||
id: '70ca08ba-6865-4630-b6fb-8494759aa754'
|
||||
}
|
||||
}
|
||||
id: '70ca08ba-6865-4630-b6fb-8494759aa754',
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
export default define(meta, async (ps, user) => {
|
||||
const clip = await Clips.findOne({
|
||||
id: ps.clipId,
|
||||
userId: user.id
|
||||
userId: user.id,
|
||||
});
|
||||
|
||||
if (clip == null) {
|
||||
|
||||
@@ -14,9 +14,9 @@ export const meta = {
|
||||
items: {
|
||||
type: 'object' as const,
|
||||
optional: false as const, nullable: false as const,
|
||||
ref: 'Clip'
|
||||
}
|
||||
}
|
||||
ref: 'Clip',
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
export default define(meta, async (ps, me) => {
|
||||
|
||||
@@ -22,7 +22,7 @@ export const meta = {
|
||||
|
||||
limit: {
|
||||
validator: $.optional.num.range(1, 100),
|
||||
default: 10
|
||||
default: 10,
|
||||
},
|
||||
|
||||
sinceId: {
|
||||
@@ -38,8 +38,8 @@ export const meta = {
|
||||
noSuchClip: {
|
||||
message: 'No such clip.',
|
||||
code: 'NO_SUCH_CLIP',
|
||||
id: '1d7645e6-2b6d-4635-b0fe-fe22b0e72e00'
|
||||
}
|
||||
id: '1d7645e6-2b6d-4635-b0fe-fe22b0e72e00',
|
||||
},
|
||||
},
|
||||
|
||||
res: {
|
||||
@@ -48,9 +48,9 @@ export const meta = {
|
||||
items: {
|
||||
type: 'object' as const,
|
||||
optional: false as const, nullable: false as const,
|
||||
ref: 'Note'
|
||||
}
|
||||
}
|
||||
ref: 'Note',
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
export default define(meta, async (ps, user) => {
|
||||
|
||||
@@ -21,15 +21,15 @@ export const meta = {
|
||||
noSuchClip: {
|
||||
message: 'No such clip.',
|
||||
code: 'NO_SUCH_CLIP',
|
||||
id: 'c3c5fe33-d62c-44d2-9ea5-d997703f5c20'
|
||||
id: 'c3c5fe33-d62c-44d2-9ea5-d997703f5c20',
|
||||
},
|
||||
},
|
||||
|
||||
res: {
|
||||
type: 'object' as const,
|
||||
optional: false as const, nullable: false as const,
|
||||
ref: 'Clip'
|
||||
}
|
||||
ref: 'Clip',
|
||||
},
|
||||
};
|
||||
|
||||
export default define(meta, async (ps, me) => {
|
||||
|
||||
@@ -21,34 +21,34 @@ export const meta = {
|
||||
},
|
||||
|
||||
isPublic: {
|
||||
validator: $.optional.bool
|
||||
validator: $.optional.bool,
|
||||
},
|
||||
|
||||
description: {
|
||||
validator: $.optional.nullable.str.range(1, 2048)
|
||||
}
|
||||
validator: $.optional.nullable.str.range(1, 2048),
|
||||
},
|
||||
},
|
||||
|
||||
errors: {
|
||||
noSuchClip: {
|
||||
message: 'No such clip.',
|
||||
code: 'NO_SUCH_CLIP',
|
||||
id: 'b4d92d70-b216-46fa-9a3f-a8c811699257'
|
||||
id: 'b4d92d70-b216-46fa-9a3f-a8c811699257',
|
||||
},
|
||||
},
|
||||
|
||||
res: {
|
||||
type: 'object' as const,
|
||||
optional: false as const, nullable: false as const,
|
||||
ref: 'Clip'
|
||||
}
|
||||
ref: 'Clip',
|
||||
},
|
||||
};
|
||||
|
||||
export default define(meta, async (ps, user) => {
|
||||
// Fetch the clip
|
||||
const clip = await Clips.findOne({
|
||||
id: ps.clipId,
|
||||
userId: user.id
|
||||
userId: user.id,
|
||||
});
|
||||
|
||||
if (clip == null) {
|
||||
|
||||
Reference in New Issue
Block a user