feat: change default review scores to 0 and improve textarea styling

This commit is contained in:
Esa Kataja
2025-05-13 21:15:13 +03:00
parent 3c8c2f76d3
commit 5f092421eb
+12 -10
View File
@@ -41,9 +41,9 @@ const user = ref<User | null>(null)
const review = ref<Review | null>(null) const review = ref<Review | null>(null)
// Form state with default values // Form state with default values
const song = ref(50) const song = ref(0)
const show = ref(50) const show = ref(0)
const costume = ref(50) const costume = ref(0)
const textReview = ref('') const textReview = ref('')
const isSubmitting = ref(false) const isSubmitting = ref(false)
@@ -91,9 +91,9 @@ async function fetchUserReview(userId: number) {
// Pre-fill form with existing review data // Pre-fill form with existing review data
if (reviewData) { if (reviewData) {
song.value = reviewData.score_song || 50 song.value = reviewData.score_song || 0
show.value = reviewData.score_show || 50 show.value = reviewData.score_show || 0
costume.value = reviewData.score_costume || 50 costume.value = reviewData.score_costume || 0
textReview.value = reviewData.text_review || '' textReview.value = reviewData.text_review || ''
} }
} catch (error) { } catch (error) {
@@ -210,15 +210,16 @@ onMounted(async () => {
<div class="flex flex-col gap-2"> <div class="flex flex-col gap-2">
<label for="text_review">Arvostelu (vaihtoehtoinen)</label> <label for="text_review">Arvostelu (vaihtoehtoinen)</label>
<textarea id="text_review" placeholder="Arvostelu" class="textfield" v-model="textReview"/> <textarea id="text_review" placeholder="Arvostelu" class="textfield" rows="6" v-model="textReview"/>
</div> </div>
<button type="submit" class="btn-primary">Arvostele</button> <button type="submit" class="btn-primary">Arvostele</button>
</form> </form>
</div> <NuxtLink class="btn-primary" to="/">Palaa etusivulle</NuxtLink>
<div v-else> </div>
<div v-else>
<h1>Artist not found</h1> <h1>Artist not found</h1>
</div> </div>
</template> </template>
<style> <style>
@@ -244,5 +245,6 @@ onMounted(async () => {
padding: 6px; padding: 6px;
background-color: rgba(255, 255, 255, 0.2); background-color: rgba(255, 255, 255, 0.2);
border-radius: 6px; border-radius: 6px;
resize: none;
} }
</style> </style>