Skip to content

Commit

Permalink
Extracted API type into its own file
Browse files Browse the repository at this point in the history
* Fixed typo
  • Loading branch information
TLTimeplex committed Oct 2, 2024
1 parent 99b9e0d commit 189791a
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 13 deletions.
29 changes: 29 additions & 0 deletions resources/interface/Gallery/Fursuit.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
/**
* API Item for the gallery used by the backend
*
* Fursuit interface for usage for the gallery items
*/
export interface Fursuit {
/**
* Database ID of the fursuit
*/
id: number,
/**
* Name of the fursuit
*/
name: string,
/**
* Species of the fursuit
*/
species: string,
/**
* Image url of the fursuit (Temporary link)
*/
image: string,
/**
* Fursuit got caught X times
*/
scoring: number,
}

export default Fursuit;
4 changes: 3 additions & 1 deletion resources/js/Components/Gallery/GalleryItem.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
<script setup>
import Fursuit from "../../../interface/Gallery/Fursuit.js";
const props = defineProps({
fursuit: Object,
fursuit: Fursuit,
});
</script>

Expand Down
18 changes: 6 additions & 12 deletions resources/js/Pages/Gallery/GalleryIndex.vue
Original file line number Diff line number Diff line change
@@ -1,21 +1,16 @@
<script setup lang="ts">
// @ts-ignore
import Layout from "@/Layouts/Layout.vue";
import {Head, router} from '@inertiajs/vue3'
// @ts-ignore
import GalleryItem from "@/Components/Gallery/GalleryItem.vue";
// @ts-ignore
import Pagination from "@/Components/Gallery/Pagination.vue";
import {Head, router} from '@inertiajs/vue3'
import {ref} from "vue";
import Pagnation from "@/Components/Gallery/Pagination.vue";
import Fursuit from "../../../interface/Gallery/Fursuit";
defineOptions({layout: Layout})
interface Fursuit {
id: number,
name: string,
species: string,
image: string,
scoring: string,
}
const props = defineProps({
fursuit: Array<Fursuit>,
site: Number,
Expand Down Expand Up @@ -45,7 +40,6 @@ function openImageInNewTab() {
</script>

<template>

<Head title="Gallery"/>
<div class="py-16">
<div class="text-xl">Gallery</div>
Expand Down Expand Up @@ -82,7 +76,7 @@ function openImageInNewTab() {
</div>
</div>
<!-- Pagnation -->
<Pagnation
<Pagination
:site="props.site"
:maxSite="props.maxSite"
:routeForwards="() => {router.visit(route('gallery.site', { site: props.site + 1 }));}"
Expand Down

0 comments on commit 189791a

Please sign in to comment.