Skip to content

Commit

Permalink
- Refactored ORM schemas to decorators (#379)
Browse files Browse the repository at this point in the history
- Replaced nuxt-typed-router module with native nuxt functionality
  • Loading branch information
mlhaufe authored Oct 3, 2024
1 parent 726e4a5 commit b3c1324
Show file tree
Hide file tree
Showing 224 changed files with 1,071 additions and 1,330 deletions.
4 changes: 2 additions & 2 deletions components/WorkboxDataView.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<script lang="ts" setup>
import type { Requirement } from '~/server/domain/requirements/Requirement';
import type { ParsedRequirement } from '~/server/domain/requirements/ParsedRequirement';
import type { Requirement } from '~/server/domain/Requirement.js';
import type { ParsedRequirement } from '~/server/domain/ParsedRequirement.js';
type RowType = { id: string; name: string; }
Expand Down
2 changes: 1 addition & 1 deletion components/XDataTable.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import type Dialog from 'primevue/dialog'
import type DataTable from 'primevue/datatable'
import { FilterMatchMode } from 'primevue/api';
import camelCaseToTitle from '~/utils/camelCaseToTitle';
import camelCaseToTitle from '~/utils/camelCaseToTitle.js';
export type ViewFieldType = 'text' | 'textarea' | 'number' | 'date' | 'boolean' | 'hidden' | 'object'
Expand Down
15 changes: 9 additions & 6 deletions middleware/org-solution-check.global.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,23 +3,26 @@
* Check if the organization exists. If not redirect to the home page.
*/
export default defineNuxtRouteMiddleware(async (to, from) => {
if (to.params.organizationslug) {
// @ts-expect-error : For some reason the typed params are not being recognized
const { organizationslug, solutionslug } = to.params

if (organizationslug) {
const organizations = await $fetch('/api/organizations', {
query: { slug: to.params.organizationslug }
query: { slug: organizationslug }
})

if (!(organizations ?? []).length) {
return navigateTo('/')
} else if (to.params.solutionslug) {
} else if (solutionslug) {
const solutions = await $fetch('/api/solutions', {
query: {
organizationSlug: to.params.organizationslug,
slug: to.params.solutionslug
organizationSlug: organizationslug,
slug: solutionslug
}
})

if (!(solutions ?? []).length)
return navigateTo(`/o/${to.params.organizationslug}`)
return navigateTo(`/o/${organizationslug}`)
}
}
})
Loading

0 comments on commit b3c1324

Please sign in to comment.