Skip to content

Commit

Permalink
fix: remove posts without ID
Browse files Browse the repository at this point in the history
  • Loading branch information
AlejandroAkbal committed Jul 29, 2021
1 parent 5da8f99 commit 63cef83
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion store/booru.js
Original file line number Diff line number Diff line change
Expand Up @@ -398,7 +398,14 @@ export const actions = {
)

// This is how a final booru object looks like
const POSTS = response.map((POST) => {
const POSTS = response.flatMap((POST) => {
// TODO: This should be handled by the API
// Remove element if it doesn't have an ID
if (!POST.id) {
console.debug('Post does not have an ID, removing it...')
return []
}

return {
id: `${ACTIVE_BOORU_DOMAIN}-${POST.id}`,
data: POST,
Expand Down

0 comments on commit 63cef83

Please sign in to comment.