Skip to content

Commit

Permalink
manual lint fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
aspalding committed Oct 30, 2023
1 parent 5f209b4 commit 9f1e1fb
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
3 changes: 2 additions & 1 deletion net/activity.js
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ module.exports = {
let activity = req.body
let object = resLocal.object
resLocal.status = 200
let question
/* isNewActivity:
false - this inbox has seen this activity before
'new collection' - known activity, new inbox
Expand Down Expand Up @@ -190,7 +191,7 @@ module.exports = {
}
break
case 'create':
const question = resLocal.linked.find(({ type }) => type.toLowerCase() === 'question')
question = resLocal.linked.find(({ type }) => type.toLowerCase() === 'question')
if (question) {
let questionType
const targetActivity = object
Expand Down
2 changes: 1 addition & 1 deletion net/validators.js
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ function inboxActivity (req, res, next) {
}
} else if (Object.hasOwn(question, 'anyOf')) {
const hasDuplicateVote = question._meta?.voteAndVoter[0].some(({ voter, voteName }) => {
return voter === activity.actor[0] && activity.object[0].name == voteName
return voter === activity.actor[0] && activity.object[0].name === voteName
})
if (hasDuplicateVote) {
resLocal.status = 403
Expand Down
4 changes: 2 additions & 2 deletions spec/functional/inbox.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -1511,7 +1511,7 @@ describe('inbox', function () {
})
})

fdescribe('question', function () {
describe('question', function () {
let activity
let question
let reply
Expand Down Expand Up @@ -1591,7 +1591,7 @@ describe('inbox', function () {
.send(reply)
.expect(200)

storedReply = await apex.store.getActivity(reply.id, true)
const storedReply = await apex.store.getActivity(reply.id, true)
expect(storedReply._meta.collection).toContain('https://localhost/o/49e2d03d-b53a-4c4c-a95c-94a6abf45a19/votes/Yes')
})
it('the question replies collection is updated', async function () {
Expand Down

0 comments on commit 9f1e1fb

Please sign in to comment.