fix lint
This commit is contained in:
@@ -16,7 +16,7 @@ export const meta = {
|
||||
|
||||
limit: {
|
||||
duration: ms('1hour'),
|
||||
max: 300
|
||||
max: 300,
|
||||
},
|
||||
|
||||
params: {
|
||||
@@ -33,11 +33,11 @@ export const meta = {
|
||||
},
|
||||
|
||||
content: {
|
||||
validator: $.arr($.obj())
|
||||
validator: $.arr($.obj()),
|
||||
},
|
||||
|
||||
variables: {
|
||||
validator: $.arr($.obj())
|
||||
validator: $.arr($.obj()),
|
||||
},
|
||||
|
||||
script: {
|
||||
@@ -50,17 +50,17 @@ export const meta = {
|
||||
|
||||
font: {
|
||||
validator: $.optional.str.or(['serif', 'sans-serif']),
|
||||
default: 'sans-serif'
|
||||
default: 'sans-serif',
|
||||
},
|
||||
|
||||
alignCenter: {
|
||||
validator: $.optional.bool,
|
||||
default: false
|
||||
default: false,
|
||||
},
|
||||
|
||||
hideTitleWhenPinned: {
|
||||
validator: $.optional.bool,
|
||||
default: false
|
||||
default: false,
|
||||
},
|
||||
},
|
||||
|
||||
@@ -74,14 +74,14 @@ export const meta = {
|
||||
noSuchFile: {
|
||||
message: 'No such file.',
|
||||
code: 'NO_SUCH_FILE',
|
||||
id: 'b7b97489-0f66-4b12-a5ff-b21bd63f6e1c'
|
||||
id: 'b7b97489-0f66-4b12-a5ff-b21bd63f6e1c',
|
||||
},
|
||||
nameAlreadyExists: {
|
||||
message: 'Specified name already exists.',
|
||||
code: 'NAME_ALREADY_EXISTS',
|
||||
id: '4650348e-301c-499a-83c9-6aa988c66bc1'
|
||||
}
|
||||
}
|
||||
id: '4650348e-301c-499a-83c9-6aa988c66bc1',
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
export default define(meta, async (ps, user) => {
|
||||
@@ -89,7 +89,7 @@ export default define(meta, async (ps, user) => {
|
||||
if (ps.eyeCatchingImageId != null) {
|
||||
eyeCatchingImage = await DriveFiles.findOne({
|
||||
id: ps.eyeCatchingImageId,
|
||||
userId: user.id
|
||||
userId: user.id,
|
||||
});
|
||||
|
||||
if (eyeCatchingImage == null) {
|
||||
@@ -99,7 +99,7 @@ export default define(meta, async (ps, user) => {
|
||||
|
||||
await Pages.find({
|
||||
userId: user.id,
|
||||
name: ps.name
|
||||
name: ps.name,
|
||||
}).then(result => {
|
||||
if (result.length > 0) {
|
||||
throw new ApiError(meta.errors.nameAlreadyExists);
|
||||
@@ -121,7 +121,7 @@ export default define(meta, async (ps, user) => {
|
||||
visibility: 'public',
|
||||
alignCenter: ps.alignCenter,
|
||||
hideTitleWhenPinned: ps.hideTitleWhenPinned,
|
||||
font: ps.font
|
||||
font: ps.font,
|
||||
}));
|
||||
|
||||
return await Pages.pack(page);
|
||||
|
@@ -21,15 +21,15 @@ export const meta = {
|
||||
noSuchPage: {
|
||||
message: 'No such page.',
|
||||
code: 'NO_SUCH_PAGE',
|
||||
id: 'eb0c6e1d-d519-4764-9486-52a7e1c6392a'
|
||||
id: 'eb0c6e1d-d519-4764-9486-52a7e1c6392a',
|
||||
},
|
||||
|
||||
accessDenied: {
|
||||
message: 'Access denied.',
|
||||
code: 'ACCESS_DENIED',
|
||||
id: '8b741b3e-2c22-44b3-a15f-29949aa1601e'
|
||||
id: '8b741b3e-2c22-44b3-a15f-29949aa1601e',
|
||||
},
|
||||
}
|
||||
},
|
||||
};
|
||||
|
||||
export default define(meta, async (ps, user) => {
|
||||
|
@@ -13,7 +13,7 @@ export const meta = {
|
||||
type: 'object' as const,
|
||||
optional: false as const, nullable: false as const,
|
||||
ref: 'Page',
|
||||
}
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
|
@@ -15,28 +15,28 @@ export const meta = {
|
||||
params: {
|
||||
pageId: {
|
||||
validator: $.type(ID),
|
||||
}
|
||||
},
|
||||
},
|
||||
|
||||
errors: {
|
||||
noSuchPage: {
|
||||
message: 'No such page.',
|
||||
code: 'NO_SUCH_PAGE',
|
||||
id: 'cc98a8a2-0dc3-4123-b198-62c71df18ed3'
|
||||
id: 'cc98a8a2-0dc3-4123-b198-62c71df18ed3',
|
||||
},
|
||||
|
||||
yourPage: {
|
||||
message: 'You cannot like your page.',
|
||||
code: 'YOUR_PAGE',
|
||||
id: '28800466-e6db-40f2-8fae-bf9e82aa92b8'
|
||||
id: '28800466-e6db-40f2-8fae-bf9e82aa92b8',
|
||||
},
|
||||
|
||||
alreadyLiked: {
|
||||
message: 'The page has already been liked.',
|
||||
code: 'ALREADY_LIKED',
|
||||
id: 'cc98a8a2-0dc3-4123-b198-62c71df18ed3'
|
||||
id: 'cc98a8a2-0dc3-4123-b198-62c71df18ed3',
|
||||
},
|
||||
}
|
||||
},
|
||||
};
|
||||
|
||||
export default define(meta, async (ps, user) => {
|
||||
@@ -52,7 +52,7 @@ export default define(meta, async (ps, user) => {
|
||||
// if already liked
|
||||
const exist = await PageLikes.findOne({
|
||||
pageId: page.id,
|
||||
userId: user.id
|
||||
userId: user.id,
|
||||
});
|
||||
|
||||
if (exist != null) {
|
||||
@@ -64,7 +64,7 @@ export default define(meta, async (ps, user) => {
|
||||
id: genId(),
|
||||
createdAt: new Date(),
|
||||
pageId: page.id,
|
||||
userId: user.id
|
||||
userId: user.id,
|
||||
});
|
||||
|
||||
Pages.increment({ id: page.id }, 'likedCount', 1);
|
||||
|
@@ -34,9 +34,9 @@ export const meta = {
|
||||
noSuchPage: {
|
||||
message: 'No such page.',
|
||||
code: 'NO_SUCH_PAGE',
|
||||
id: '222120c0-3ead-4528-811b-b96f233388d7'
|
||||
}
|
||||
}
|
||||
id: '222120c0-3ead-4528-811b-b96f233388d7',
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
export default define(meta, async (ps, user) => {
|
||||
@@ -47,12 +47,12 @@ export default define(meta, async (ps, user) => {
|
||||
} else if (ps.name && ps.username) {
|
||||
const author = await Users.findOne({
|
||||
host: null,
|
||||
usernameLower: ps.username.toLowerCase()
|
||||
usernameLower: ps.username.toLowerCase(),
|
||||
});
|
||||
if (author) {
|
||||
page = await Pages.findOne({
|
||||
name: ps.name,
|
||||
userId: author.id
|
||||
userId: author.id,
|
||||
});
|
||||
}
|
||||
}
|
||||
|
@@ -14,22 +14,22 @@ export const meta = {
|
||||
params: {
|
||||
pageId: {
|
||||
validator: $.type(ID),
|
||||
}
|
||||
},
|
||||
},
|
||||
|
||||
errors: {
|
||||
noSuchPage: {
|
||||
message: 'No such page.',
|
||||
code: 'NO_SUCH_PAGE',
|
||||
id: 'a0d41e20-1993-40bd-890e-f6e560ae648e'
|
||||
id: 'a0d41e20-1993-40bd-890e-f6e560ae648e',
|
||||
},
|
||||
|
||||
notLiked: {
|
||||
message: 'You have not liked that page.',
|
||||
code: 'NOT_LIKED',
|
||||
id: 'f5e586b0-ce93-4050-b0e3-7f31af5259ee'
|
||||
id: 'f5e586b0-ce93-4050-b0e3-7f31af5259ee',
|
||||
},
|
||||
}
|
||||
},
|
||||
};
|
||||
|
||||
export default define(meta, async (ps, user) => {
|
||||
@@ -40,7 +40,7 @@ export default define(meta, async (ps, user) => {
|
||||
|
||||
const exist = await PageLikes.findOne({
|
||||
pageId: page.id,
|
||||
userId: user.id
|
||||
userId: user.id,
|
||||
});
|
||||
|
||||
if (exist == null) {
|
||||
|
@@ -15,7 +15,7 @@ export const meta = {
|
||||
|
||||
limit: {
|
||||
duration: ms('1hour'),
|
||||
max: 300
|
||||
max: 300,
|
||||
},
|
||||
|
||||
params: {
|
||||
@@ -36,11 +36,11 @@ export const meta = {
|
||||
},
|
||||
|
||||
content: {
|
||||
validator: $.arr($.obj())
|
||||
validator: $.arr($.obj()),
|
||||
},
|
||||
|
||||
variables: {
|
||||
validator: $.arr($.obj())
|
||||
validator: $.arr($.obj()),
|
||||
},
|
||||
|
||||
script: {
|
||||
@@ -68,26 +68,26 @@ export const meta = {
|
||||
noSuchPage: {
|
||||
message: 'No such page.',
|
||||
code: 'NO_SUCH_PAGE',
|
||||
id: '21149b9e-3616-4778-9592-c4ce89f5a864'
|
||||
id: '21149b9e-3616-4778-9592-c4ce89f5a864',
|
||||
},
|
||||
|
||||
accessDenied: {
|
||||
message: 'Access denied.',
|
||||
code: 'ACCESS_DENIED',
|
||||
id: '3c15cd52-3b4b-4274-967d-6456fc4f792b'
|
||||
id: '3c15cd52-3b4b-4274-967d-6456fc4f792b',
|
||||
},
|
||||
|
||||
noSuchFile: {
|
||||
message: 'No such file.',
|
||||
code: 'NO_SUCH_FILE',
|
||||
id: 'cfc23c7c-3887-490e-af30-0ed576703c82'
|
||||
id: 'cfc23c7c-3887-490e-af30-0ed576703c82',
|
||||
},
|
||||
nameAlreadyExists: {
|
||||
message: 'Specified name already exists.',
|
||||
code: 'NAME_ALREADY_EXISTS',
|
||||
id: '2298a392-d4a1-44c5-9ebb-ac1aeaa5a9ab'
|
||||
}
|
||||
}
|
||||
id: '2298a392-d4a1-44c5-9ebb-ac1aeaa5a9ab',
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
export default define(meta, async (ps, user) => {
|
||||
@@ -103,7 +103,7 @@ export default define(meta, async (ps, user) => {
|
||||
if (ps.eyeCatchingImageId != null) {
|
||||
eyeCatchingImage = await DriveFiles.findOne({
|
||||
id: ps.eyeCatchingImageId,
|
||||
userId: user.id
|
||||
userId: user.id,
|
||||
});
|
||||
|
||||
if (eyeCatchingImage == null) {
|
||||
@@ -114,7 +114,7 @@ export default define(meta, async (ps, user) => {
|
||||
await Pages.find({
|
||||
id: Not(ps.pageId),
|
||||
userId: user.id,
|
||||
name: ps.name
|
||||
name: ps.name,
|
||||
}).then(result => {
|
||||
if (result.length > 0) {
|
||||
throw new ApiError(meta.errors.nameAlreadyExists);
|
||||
|
Reference in New Issue
Block a user