Skip to content

Commit

Permalink
fix bug in index lookup
Browse files Browse the repository at this point in the history
  • Loading branch information
maxboeck committed Apr 15, 2019
1 parent 6af3068 commit e48dccb
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions _lambda/common/utils.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import members from '../../src/data/members'

export const redirect = site => {
const statusMessage = `redirecting to: ${site.title}`
const statusMessage = `redirecting to: ${site.url}`
console.log(statusMessage)

return {
Expand All @@ -11,7 +11,8 @@ export const redirect = site => {
}
}

export const getIndex = url => members.findIndex(site => url.includes(site.url))
export const getIndex = url =>
url ? members.findIndex(site => url.includes(site.url)) : -1

export const getNext = url => {
const index = getIndex(url)
Expand Down

0 comments on commit e48dccb

Please sign in to comment.