You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
20 lines
422 B
JavaScript
20 lines
422 B
JavaScript
import { router } from '@inertiajs/react'
|
|
|
|
export const ALL = 0
|
|
export const FAVORITE = 1
|
|
|
|
export const handleBanner = (banner) => {
|
|
router.get(route('home.banner', banner))
|
|
}
|
|
|
|
export const isFavorite = (user, id) => {
|
|
if (user === null) {
|
|
return false
|
|
}
|
|
const isExists = user.location_favorites.findIndex((f) => f.id === id)
|
|
if (isExists !== -1) {
|
|
return true
|
|
}
|
|
return false
|
|
}
|