diff --git a/migrations/2021-09-13-143540_sections/up.sql b/migrations/2021-09-13-143540_sections/up.sql index 0c5ca76..64b80cb 100644 --- a/migrations/2021-09-13-143540_sections/up.sql +++ b/migrations/2021-09-13-143540_sections/up.sql @@ -4,6 +4,8 @@ create table sections ( -- Title of the section title varchar(255) UNIQUE NOT NULL, + -- Name to use when routing (this just makes for prettier URLs) + shortname varchar(32) UNIQUE NOT NULL, -- Optional description of the section description text, -- Wether to show the section in the default list on the homepage diff --git a/web2/package.json b/web2/package.json index 4a7220b..64c0d5b 100644 --- a/web2/package.json +++ b/web2/package.json @@ -10,9 +10,11 @@ "vue": "^3.2.16" }, "devDependencies": { + "@types/node": "^16.10.3", "@vitejs/plugin-vue": "^1.9.3", + "miragejs": "^0.1.42", "typescript": "^4.4.3", "vite": "^2.6.4", "vue-tsc": "^0.3.0" } -} \ No newline at end of file +} diff --git a/web2/src/components/HelloWorld.vue b/web2/src/components/HelloWorld.vue index 2d61249..2af73ad 100644 --- a/web2/src/components/HelloWorld.vue +++ b/web2/src/components/HelloWorld.vue @@ -4,11 +4,24 @@ import { ref } from 'vue' defineProps<{ msg: string }>() const count = ref(0) +let test = ref("yeet") + +fetch("/api/users").then( + res => { + if (!res.ok) return Promise.reject() + + return res.json() + } +).then( + json => test.value = json +)