mealie/frontend/composables/use-router.ts
Hayden bdaf758712
feat(backend): start multi-tenant support (WIP) (#680)
* fix ts types

* feat(code-generation): ♻️ update code-generation formats

* new scope

* add step button

* fix linter error

* update code-generation tags

* feat(backend):  start multi-tenant support

* feat(backend):  group invitation token generation and signup

* refactor(backend): ♻️ move group admin actions to admin router

* set url base to include `/admin`

* feat(frontend):  generate user sign-up links

* test(backend):  refactor test-suite to further decouple tests (WIP)

* feat(backend): 🐛 assign owner on backup import for recipes

* fix(backend): 🐛 assign recipe owner on migration from other service

Co-authored-by: hay-kot <hay-kot@pm.me>
2021-09-09 08:51:29 -08:00

18 lines
457 B
TypeScript

import { useRoute, WritableComputedRef, computed } from "@nuxtjs/composition-api";
export function useRouterQuery(query: string) {
const router = useRoute();
// TODO FUTURE: Remove when migrating to Vue 3
const param: WritableComputedRef<string> = computed({
get(): string {
// @ts-ignore
return router.value?.query[query] || "";
},
set(v: string): void {
router.value.query[query] = v;
},
});
return param;
}