Added basic shack creation.
This commit is contained in:
@@ -21,5 +21,22 @@
|
||||
class="link"
|
||||
>Sign up</a></li>
|
||||
</ul>
|
||||
|
||||
<ul>
|
||||
<li
|
||||
v-for="shelf in shelves"
|
||||
:key="shelf.id"
|
||||
><a
|
||||
:href="`/s/${shelf.slug}`"
|
||||
class="link"
|
||||
>{{ shelf.slug }}</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { usePageContext } from '../../renderer/usePageContext';
|
||||
|
||||
const { pageData } = usePageContext();
|
||||
const { shelves } = pageData;
|
||||
</script>
|
||||
|
||||
@@ -1,71 +0,0 @@
|
||||
<template>
|
||||
<div class="content">
|
||||
<a
|
||||
href="/"
|
||||
class="link"
|
||||
>Go back home</a>
|
||||
|
||||
<h3>{{ shuck }}</h3>
|
||||
|
||||
<form
|
||||
class="form compose"
|
||||
@submit.prevent="submitPost"
|
||||
>
|
||||
<div class="form-row">
|
||||
<input
|
||||
v-model="title"
|
||||
placeholder="Title"
|
||||
class="input"
|
||||
>
|
||||
</div>
|
||||
|
||||
<div class="form-row">
|
||||
<input
|
||||
v-model="link"
|
||||
class="input"
|
||||
placeholder="Link"
|
||||
>
|
||||
</div>
|
||||
|
||||
<div class="form-row">
|
||||
<textarea
|
||||
v-model="body"
|
||||
placeholder="Body"
|
||||
class="input body"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div class="form-actions">
|
||||
<button class="button button-submit">Post</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref } from 'vue';
|
||||
|
||||
const shuck = 'Eratic';
|
||||
|
||||
// const route = useRoute();
|
||||
// const res = await useFetch(`/api/shucks/${route.params.id}/posts`);
|
||||
|
||||
const title = ref();
|
||||
const link = ref();
|
||||
const body = ref();
|
||||
|
||||
async function submitPost() {
|
||||
console.log('POST', link.value);
|
||||
|
||||
/*
|
||||
await useFetch(`/api/shucks/${route.params.id}/posts`, {
|
||||
method: 'post',
|
||||
body: {
|
||||
title,
|
||||
link,
|
||||
body,
|
||||
},
|
||||
});
|
||||
*/
|
||||
}
|
||||
</script>
|
||||
Reference in New Issue
Block a user