Skip to content

Commit

Permalink
lint: fix lint issue in media resolver (#159)
Browse files Browse the repository at this point in the history
  • Loading branch information
120EE0692 authored Nov 5, 2022
1 parent 53f2d03 commit fad22c7
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions server/schema/media/media.resolver.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ module.exports = {
throw APIError(null, error);
}
},
addMedia: async (
addMedia: (
_parent,
{ imageKitFileID, authors, store, storePath, mediaType, blurhash },
{ mid, session, authToken, decodedToken, API: { Media } }
Expand All @@ -33,7 +33,7 @@ module.exports = {
reason: 'The user does not have the required permission to perform this operation.',
});
}
imagekit.getFileDetails(imageKitFileID, function (err, res) {
imagekit.getFileDetails(imageKitFileID, (err, _) => {
if (err) {
throw APIError('Image not uploaded', null, err);
} else {
Expand All @@ -55,7 +55,7 @@ module.exports = {
throw APIError(null, error);
}
},
deleteMediaById: async (_parent, { id, imageKitFileID }, { session, authToken, decodedToken, API: { Media } }) => {
deleteMediaById: (_parent, { id, imageKitFileID }, { session, authToken, decodedToken, API: { Media } }) => {
try {
if (
!UserPermission.exists(session, authToken, decodedToken, 'media.write.all') ||
Expand All @@ -65,13 +65,12 @@ module.exports = {
reason: 'The user does not have the required permission to perform this operation.',
});
}
imagekit.getFileDetails(imageKitFileID, function (err, res) {
imagekit.getFileDetails(imageKitFileID, (err, res) => {
if (err) {
const _deletedMedia = Media.deleteById(id);
return _deletedMedia;
} else {
throw APIError('Image not deleted', null, res);
}
throw APIError('Image not deleted', null, res);
});
} catch (error) {
throw APIError(null, error);
Expand Down

0 comments on commit fad22c7

Please sign in to comment.