Skip to content

Commit

Permalink
Fixed Typescript errors
Browse files Browse the repository at this point in the history
  • Loading branch information
IsaacHatilima committed Oct 8, 2024
1 parent 15d164b commit 91defb7
Show file tree
Hide file tree
Showing 175 changed files with 101 additions and 94 deletions.
2 changes: 1 addition & 1 deletion app/Services/AlbumService.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public function createAlbum($request)

public function updateAlbum($request,$album)
{
$album->name = $request->name;
$album->name = strtoupper($request->name);
$album->description = $request->description;
return $album->save();
}
Expand Down
8 changes: 4 additions & 4 deletions resources/js/Layouts/AuthenticatedLayout.vue
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<script lang="ts" setup>
import SideNav from "@/Components/sidenav/SideNav.vue";
import TopNav from "@/Components/TopNav.vue";
import {Toaster} from '@/Components/ui/toast'
import {ScrollArea} from '@/Components/ui/scroll-area'
import SideNav from "@/components/sidenav/SideNav.vue";
import TopNav from "@/components/TopNav.vue";
import {Toaster} from '@/components/ui/toast'
import {ScrollArea} from '@/components/ui/scroll-area'
</script>

<template>
Expand Down
4 changes: 2 additions & 2 deletions resources/js/Layouts/GuestLayout.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<script setup lang="ts">
import ApplicationLogo from '@/Components/ApplicationLogo.vue';
import ApplicationLogo from '@/components/ApplicationLogo.vue';
import { Link } from '@inertiajs/vue3';
import {
Card,
Expand All @@ -8,7 +8,7 @@ import {
CardFooter,
CardHeader,
CardTitle,
} from '@/Components/ui/card'
} from '@/components/ui/card'
</script>

<template>
Expand Down
48 changes: 27 additions & 21 deletions resources/js/Pages/Albums.vue
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import {
DialogHeader,
DialogTitle,
DialogTrigger,
} from '@/Components/ui/dialog';
} from '@/components/ui/dialog';
import {
AlertDialog,
AlertDialogAction,
Expand All @@ -21,35 +21,43 @@ import {
AlertDialogTitle,
AlertDialogTrigger,
} from '@/components/ui/alert-dialog'
import { Button } from '@/Components/ui/button'
import {Label} from "@/Components/ui/label";
import {Input} from "@/Components/ui/input";
import InputError from "@/Components/InputError.vue";
import {CardContent, Card, CardHeader, CardTitle} from "@/Components/ui/card";
import dayjs from 'dayjs';
import {useToast} from '@/Components/ui/toast/use-toast';
import {Button} from '@/components/ui/button'
import {Label} from "@/components/ui/label";
import {Input} from "@/components/ui/input";
import InputError from "@/components/InputError.vue";
import {Card, CardContent} from "@/components/ui/card";
import {useToast} from '@/components/ui/toast/use-toast';
import {computed, ref} from 'vue';
interface Album {
public_id: string;
name: string;
description: string;
created_at: string;
deleted_at?: string;
}
const {toast} = useToast();
let albums = usePage().props.albums;
let albums = usePage().props.albums as Album[];
const searchQuery = ref('');
const selectedAlbum = ref({ name: '', description: '' });
const filteredAlbums = computed(() => {
return albums.filter(album =>
album.name.toLowerCase().includes(searchQuery.value.toLowerCase())
);
});
const formatDate = (date) => {
return dayjs(date).format('YYYY-MM-DD HH:mm');
};
function formatDate(date: string): string {
return new Date(date).toLocaleDateString();
}
const form = useForm({
name: '',
description: ''
});
const refreshAlbums = (routeName) => {
const refreshAlbums = (routeName: string) => {
router.visit(route(routeName), {
preserveScroll: true,
only: ['albums'],
Expand Down Expand Up @@ -78,12 +86,11 @@ const handleSubmit = () => {
});
};
const selectedAlbum = ref({ name: '', description: '' });
const selectAlbum = (album) => {
const selectAlbum = (album: Album) => {
selectedAlbum.value = { ...album };
};
const handleUpdate = (albumId) => {
const handleUpdate = (albumId: string) => {
form.name = selectedAlbum.value.name;
form.description = selectedAlbum.value.description;
Expand All @@ -107,8 +114,7 @@ const handleUpdate = (albumId) => {
});
};
const handleDelete = (albumId) => {
const handleDelete = (albumId: string) => {
const { url } = usePage();
console.log(url)
form.delete(route('albums.destroy', albumId), {
Expand All @@ -135,7 +141,7 @@ const handleDelete = (albumId) => {
});
};
const handleArchive = (albumId) => {
const handleArchive = (albumId: string) => {
form.patch(route('albums.archive', albumId), {
onSuccess: () => {
refreshAlbums('albums.index');
Expand All @@ -156,7 +162,7 @@ const handleArchive = (albumId) => {
});
};
const handleRestore = (albumId) => {
const handleRestore = (albumId: string) => {
form.patch(route('albums.restore', albumId), {
onSuccess: () => {
refreshAlbums('albums.trashed');
Expand Down
10 changes: 5 additions & 5 deletions resources/js/Pages/Auth/ConfirmPassword.vue
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<script setup lang="ts">
import GuestLayout from '@/Layouts/GuestLayout.vue';
import InputError from '@/Components/InputError.vue';
import { Button } from '@/Components/ui/button'
import { Input } from '@/Components/ui/input'
import {CardContent, CardDescription, CardFooter, CardHeader, CardTitle} from "@/Components/ui/card";
import { Label } from '@/Components/ui/label'
import InputError from '@/components/InputError.vue';
import { Button } from '@/components/ui/button'
import { Input } from '@/components/ui/input'
import {CardContent, CardDescription, CardFooter, CardHeader, CardTitle} from "@/components/ui/card";
import { Label } from '@/components/ui/label'
import { Head, useForm } from '@inertiajs/vue3';
const form = useForm({
Expand Down
10 changes: 5 additions & 5 deletions resources/js/Pages/Auth/ForgotPassword.vue
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<script setup lang="ts">
import GuestLayout from '@/Layouts/GuestLayout.vue';
import InputError from '@/Components/InputError.vue';
import { Button } from '@/Components/ui/button'
import { Input } from '@/Components/ui/input'
import {CardContent, CardDescription, CardFooter, CardHeader, CardTitle} from "@/Components/ui/card";
import { Label } from '@/Components/ui/label'
import InputError from '@/components/InputError.vue';
import { Button } from '@/components/ui/button'
import { Input } from '@/components/ui/input'
import {CardContent, CardDescription, CardFooter, CardHeader, CardTitle} from "@/components/ui/card";
import { Label } from '@/components/ui/label'
import { Head, useForm } from '@inertiajs/vue3';
defineProps<{
Expand Down
12 changes: 6 additions & 6 deletions resources/js/Pages/Auth/Login.vue
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
<script setup lang="ts">
import GuestLayout from '@/Layouts/GuestLayout.vue';
import InputError from '@/Components/InputError.vue';
import InputError from '@/components/InputError.vue';
import { Head, Link, useForm } from '@inertiajs/vue3';
import { Button } from '@/Components/ui/button'
import { Input } from '@/Components/ui/input'
import {CardContent, CardDescription, CardFooter, CardHeader, CardTitle} from "@/Components/ui/card";
import { Label } from '@/Components/ui/label'
import { Checkbox } from '@/Components/ui/checkbox'
import { Button } from '@/components/ui/button'
import { Input } from '@/components/ui/input'
import {CardContent, CardDescription, CardFooter, CardHeader, CardTitle} from "@/components/ui/card";
import { Label } from '@/components/ui/label'
import { Checkbox } from '@/components/ui/checkbox'
defineProps<{
canResetPassword?: boolean;
Expand Down
12 changes: 6 additions & 6 deletions resources/js/Pages/Auth/Register.vue
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<script setup lang="ts">
import GuestLayout from '@/Layouts/GuestLayout.vue';
import InputError from '@/Components/InputError.vue';
import { Button } from '@/Components/ui/button'
import { Input } from '@/Components/ui/input'
import {CardContent, CardDescription, CardFooter, CardHeader, CardTitle} from "@/Components/ui/card";
import { Label } from '@/Components/ui/label'
import { Checkbox } from '@/Components/ui/checkbox'
import InputError from '@/components/InputError.vue';
import { Button } from '@/components/ui/button'
import { Input } from '@/components/ui/input'
import {CardContent, CardDescription, CardFooter, CardHeader, CardTitle} from "@/components/ui/card";
import { Label } from '@/components/ui/label'
import { Checkbox } from '@/components/ui/checkbox'
import { Head, Link, useForm } from '@inertiajs/vue3';
const form = useForm({
Expand Down
10 changes: 5 additions & 5 deletions resources/js/Pages/Auth/ResetPassword.vue
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<script setup lang="ts">
import GuestLayout from '@/Layouts/GuestLayout.vue';
import InputError from '@/Components/InputError.vue';
import { Button } from '@/Components/ui/button'
import { Input } from '@/Components/ui/input'
import {CardContent, CardDescription, CardFooter, CardHeader, CardTitle} from "@/Components/ui/card";
import { Label } from '@/Components/ui/label'
import InputError from '@/components/InputError.vue';
import { Button } from '@/components/ui/button'
import { Input } from '@/components/ui/input'
import {CardContent, CardDescription, CardFooter, CardHeader, CardTitle} from "@/components/ui/card";
import { Label } from '@/components/ui/label'
import { Head, useForm } from '@inertiajs/vue3';
const props = defineProps<{
Expand Down
8 changes: 4 additions & 4 deletions resources/js/Pages/Auth/TwoFactorAuthCode.vue
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<script setup lang="ts">
import GuestLayout from '@/Layouts/GuestLayout.vue';
import { Button } from '@/Components/ui/button';
import {CardContent} from "@/Components/ui/card";
import { useToast } from '@/Components/ui/toast/use-toast';
import { Button } from '@/components/ui/button';
import {CardContent} from "@/components/ui/card";
import { useToast } from '@/components/ui/toast/use-toast';
import { Head } from '@inertiajs/vue3';
import {PinInput, PinInputGroup, PinInputInput} from "@/Components/ui/pin-input";
import {PinInput, PinInputGroup, PinInputInput} from "@/components/ui/pin-input";
import axios from "axios";
import {ref} from "vue";
Expand Down
4 changes: 2 additions & 2 deletions resources/js/Pages/Auth/VerifyEmail.vue
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<script setup lang="ts">
import { computed } from 'vue';
import GuestLayout from '@/Layouts/GuestLayout.vue';
import { Button } from '@/Components/ui/button'
import {CardContent, CardDescription, CardFooter, CardHeader, CardTitle} from "@/Components/ui/card";
import { Button } from '@/components/ui/button'
import {CardContent, CardDescription, CardFooter, CardHeader, CardTitle} from "@/components/ui/card";
import { Head, Link, useForm } from '@inertiajs/vue3';
const props = defineProps<{
Expand Down
2 changes: 1 addition & 1 deletion resources/js/Pages/Dashboard.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<script setup lang="ts">
import AuthenticatedLayout from '@/Layouts/AuthenticatedLayout.vue';
import { Head } from '@inertiajs/vue3';
import {Button} from "@/Components/ui/button";
import {Button} from "@/components/ui/button";
</script>

Expand Down
12 changes: 6 additions & 6 deletions resources/js/Pages/Profile/Partials/DeleteUserForm.vue
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
<script setup lang="ts">
import Modal from '@/Components/Modal.vue';
import Modal from '@/components/Modal.vue';
import { Button } from '@/Components/ui/button'
import { Input } from '@/Components/ui/input'
import {CardContent} from "@/Components/ui/card";
import { Label } from '@/Components/ui/label'
import { Button } from '@/components/ui/button'
import { Input } from '@/components/ui/input'
import {CardContent} from "@/components/ui/card";
import { Label } from '@/components/ui/label'
import { useForm } from '@inertiajs/vue3';
import { ref } from 'vue';
import InputError from "@/Components/InputError.vue";
import InputError from "@/components/InputError.vue";
const confirmingUserDeletion = ref(false);
Expand Down
6 changes: 3 additions & 3 deletions resources/js/Pages/Profile/Partials/TwoFactorAuth.vue
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<script lang="ts" setup>
import {onMounted, ref} from 'vue';
import {Button} from '@/Components/ui/button';
import {useToast} from '@/Components/ui/toast/use-toast';
import {Button} from '@/components/ui/button';
import {useToast} from '@/components/ui/toast/use-toast';
import {router, useForm, usePage} from '@inertiajs/vue3';
import axios from 'axios';
import {PinInput, PinInputGroup, PinInputInput,} from '@/Components/ui/pin-input'
import {PinInput, PinInputGroup, PinInputInput,} from '@/components/ui/pin-input'
import {Inertia} from '@inertiajs/inertia';
const {toast} = useToast();
Expand Down
10 changes: 5 additions & 5 deletions resources/js/Pages/Profile/Partials/UpdatePasswordForm.vue
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<script setup lang="ts">
import InputError from '@/Components/InputError.vue';
import { Button } from '@/Components/ui/button'
import { Input } from '@/Components/ui/input'
import { Label } from '@/Components/ui/label'
import InputError from '@/components/InputError.vue';
import { Button } from '@/components/ui/button'
import { Input } from '@/components/ui/input'
import { Label } from '@/components/ui/label'
import { useForm } from 'laravel-precognition-vue-inertia';
import { ref } from 'vue';
import { useToast } from '@/Components/ui/toast/use-toast'
import { useToast } from '@/components/ui/toast/use-toast'
import {router, usePage} from "@inertiajs/vue3";
const { toast } = useToast();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<script lang="ts" setup>
import InputError from '@/Components/InputError.vue';
import {Button} from '@/Components/ui/button'
import {Input} from '@/Components/ui/input'
import {useToast} from '@/Components/ui/toast/use-toast'
import {Label} from '@/Components/ui/label'
import InputError from '@/components/InputError.vue';
import {Button} from '@/components/ui/button'
import {Input} from '@/components/ui/input'
import {useToast} from '@/components/ui/toast/use-toast'
import {Label} from '@/components/ui/label'
import {Link, router, useForm, usePage} from '@inertiajs/vue3';
import {RadioGroup, RadioGroupItem} from '@/Components/ui/radio-group';
import {RadioGroup, RadioGroupItem} from '@/components/ui/radio-group';
const {toast} = useToast();
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@ import {
DropdownMenuLabel,
DropdownMenuSeparator,
DropdownMenuTrigger
} from "@/Components/ui/dropdown-menu";
import {Card, CardContent, CardDescription, CardHeader, CardTitle} from "@/Components/ui/card";
import {Button} from "@/Components/ui/button";
import {Sheet, SheetContent, SheetDescription, SheetTitle, SheetTrigger} from "@/Components/ui/sheet";
import {Input} from "@/Components/ui/input";
} from "@/components/ui/dropdown-menu";
import {Card, CardContent, CardDescription, CardHeader, CardTitle} from "@/components/ui/card";
import {Button} from "@/components/ui/button";
import {Sheet, SheetContent, SheetDescription, SheetTitle, SheetTrigger} from "@/components/ui/sheet";
import {Input} from "@/components/ui/input";
import {Link} from '@inertiajs/vue3';
import {ScrollArea} from '@/Components/ui/scroll-area';
import {ScrollArea} from '@/components/ui/scroll-area';
import SideNavContent from "./sidenav/SideNavContent.vue";
</script>

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<script setup lang="ts">
import { Card, CardContent, CardDescription, CardHeader, CardTitle } from "@/Components/ui/card";
import { Button } from "@/Components/ui/button";
import { Card, CardContent, CardDescription, CardHeader, CardTitle } from "@/components/ui/card";
import { Button } from "@/components/ui/button";
import SideNavContent from "./SideNavContent.vue";
import { ScrollArea } from '@/Components/ui/scroll-area';
import { ScrollArea } from '@/components/ui/scroll-area';
</script>

<template>
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<script lang="ts" setup>
import {computed, type HTMLAttributes} from 'vue'
import {CalendarCellTrigger, type CalendarCellTriggerProps, useForwardProps} from 'radix-vue'
import {buttonVariants} from '@/Components/ui/button'
import {buttonVariants} from '@/components/ui/button'
import {cn} from '@/lib/utils'
const props = defineProps<CalendarCellTriggerProps & { class?: HTMLAttributes['class'] }>()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import {computed, type HTMLAttributes} from 'vue'
import {CalendarNext, type CalendarNextProps, useForwardProps} from 'radix-vue'
import {ChevronRight} from 'lucide-vue-next'
import {cn} from '@/lib/utils'
import {buttonVariants} from '@/Components/ui/button'
import {buttonVariants} from '@/components/ui/button'
const props = defineProps<CalendarNextProps & { class?: HTMLAttributes['class'] }>()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import {computed, type HTMLAttributes} from 'vue'
import {CalendarPrev, type CalendarPrevProps, useForwardProps} from 'radix-vue'
import {ChevronLeft} from 'lucide-vue-next'
import {cn} from '@/lib/utils'
import {buttonVariants} from '@/Components/ui/button'
import {buttonVariants} from '@/components/ui/button'
const props = defineProps<CalendarPrevProps & { class?: HTMLAttributes['class'] }>()
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Loading

0 comments on commit 91defb7

Please sign in to comment.