You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

10 lines
340 B

  1. import { NuxtAppOptions } from '@nuxt/types'
  2. import _ from 'lodash'
  3. export default _.debounce(async ({ app, route, redirect }: NuxtAppOptions) => {
  4. const member = await app.$repositories.member.fetchMyRole(route.params.id)
  5. if (!member.isProjectAdmin) {
  6. return redirect(app.localePath('/projects/' + route.params.id))
  7. }
  8. }, 1000)