mirror of
https://github.com/baserow/baserow.git
synced 2026-12-04 16:28:31 +00:00
23 lines
612 B
JavaScript
23 lines
612 B
JavaScript
import WorkspaceService from '@baserow/modules/core/services/workspace'
|
|
|
|
/**
|
|
* Mixin that fetches a workspace invitation based on the `workspaceInvitationToken` query
|
|
* parameter. If the token is not found, null will be added as invitation data value.
|
|
*/
|
|
export default {
|
|
async asyncData({ route, app }) {
|
|
const token = route.query.workspaceInvitationToken
|
|
|
|
if (token) {
|
|
try {
|
|
const { data: invitation } = await WorkspaceService(
|
|
app.$client
|
|
).fetchInvitationByToken(token)
|
|
return { invitation }
|
|
} catch {}
|
|
}
|
|
|
|
return { invitation: null }
|
|
},
|
|
}
|