diff --git a/app/Services/AlbumService.php b/app/Services/AlbumService.php
index 9dda173..88f567a 100644
--- a/app/Services/AlbumService.php
+++ b/app/Services/AlbumService.php
@@ -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();
}
diff --git a/resources/js/Layouts/AuthenticatedLayout.vue b/resources/js/Layouts/AuthenticatedLayout.vue
index 715f898..50c4053 100644
--- a/resources/js/Layouts/AuthenticatedLayout.vue
+++ b/resources/js/Layouts/AuthenticatedLayout.vue
@@ -1,8 +1,8 @@
diff --git a/resources/js/Layouts/GuestLayout.vue b/resources/js/Layouts/GuestLayout.vue
index 475da86..76dd156 100644
--- a/resources/js/Layouts/GuestLayout.vue
+++ b/resources/js/Layouts/GuestLayout.vue
@@ -1,5 +1,5 @@
diff --git a/resources/js/Pages/Albums.vue b/resources/js/Pages/Albums.vue
index c68e887..47a8efd 100644
--- a/resources/js/Pages/Albums.vue
+++ b/resources/js/Pages/Albums.vue
@@ -9,7 +9,7 @@ import {
DialogHeader,
DialogTitle,
DialogTrigger,
-} from '@/Components/ui/dialog';
+} from '@/components/ui/dialog';
import {
AlertDialog,
AlertDialogAction,
@@ -21,18 +21,26 @@ 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 =>
@@ -40,16 +48,16 @@ const filteredAlbums = computed(() => {
);
});
-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'],
@@ -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;
@@ -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), {
@@ -135,7 +141,7 @@ const handleDelete = (albumId) => {
});
};
-const handleArchive = (albumId) => {
+const handleArchive = (albumId: string) => {
form.patch(route('albums.archive', albumId), {
onSuccess: () => {
refreshAlbums('albums.index');
@@ -156,7 +162,7 @@ const handleArchive = (albumId) => {
});
};
-const handleRestore = (albumId) => {
+const handleRestore = (albumId: string) => {
form.patch(route('albums.restore', albumId), {
onSuccess: () => {
refreshAlbums('albums.trashed');
diff --git a/resources/js/Pages/Auth/ConfirmPassword.vue b/resources/js/Pages/Auth/ConfirmPassword.vue
index 924e4c1..6e8386e 100644
--- a/resources/js/Pages/Auth/ConfirmPassword.vue
+++ b/resources/js/Pages/Auth/ConfirmPassword.vue
@@ -1,10 +1,10 @@
diff --git a/resources/js/Pages/Profile/Partials/DeleteUserForm.vue b/resources/js/Pages/Profile/Partials/DeleteUserForm.vue
index 3138497..037395f 100644
--- a/resources/js/Pages/Profile/Partials/DeleteUserForm.vue
+++ b/resources/js/Pages/Profile/Partials/DeleteUserForm.vue
@@ -1,14 +1,14 @@
diff --git a/resources/js/Components/sidenav/SideNav.vue b/resources/js/components/sidenav/SideNav.vue
similarity index 82%
rename from resources/js/Components/sidenav/SideNav.vue
rename to resources/js/components/sidenav/SideNav.vue
index cdbd765..e96f637 100644
--- a/resources/js/Components/sidenav/SideNav.vue
+++ b/resources/js/components/sidenav/SideNav.vue
@@ -1,8 +1,8 @@
diff --git a/resources/js/Components/sidenav/SideNavContent.vue b/resources/js/components/sidenav/SideNavContent.vue
similarity index 100%
rename from resources/js/Components/sidenav/SideNavContent.vue
rename to resources/js/components/sidenav/SideNavContent.vue
diff --git a/resources/js/Components/ui/accordion/Accordion.vue b/resources/js/components/ui/accordion/Accordion.vue
similarity index 100%
rename from resources/js/Components/ui/accordion/Accordion.vue
rename to resources/js/components/ui/accordion/Accordion.vue
diff --git a/resources/js/Components/ui/accordion/AccordionContent.vue b/resources/js/components/ui/accordion/AccordionContent.vue
similarity index 100%
rename from resources/js/Components/ui/accordion/AccordionContent.vue
rename to resources/js/components/ui/accordion/AccordionContent.vue
diff --git a/resources/js/Components/ui/accordion/AccordionItem.vue b/resources/js/components/ui/accordion/AccordionItem.vue
similarity index 100%
rename from resources/js/Components/ui/accordion/AccordionItem.vue
rename to resources/js/components/ui/accordion/AccordionItem.vue
diff --git a/resources/js/Components/ui/accordion/AccordionTrigger.vue b/resources/js/components/ui/accordion/AccordionTrigger.vue
similarity index 100%
rename from resources/js/Components/ui/accordion/AccordionTrigger.vue
rename to resources/js/components/ui/accordion/AccordionTrigger.vue
diff --git a/resources/js/Components/ui/accordion/index.ts b/resources/js/components/ui/accordion/index.ts
similarity index 100%
rename from resources/js/Components/ui/accordion/index.ts
rename to resources/js/components/ui/accordion/index.ts
diff --git a/resources/js/Components/ui/alert-dialog/AlertDialog.vue b/resources/js/components/ui/alert-dialog/AlertDialog.vue
similarity index 100%
rename from resources/js/Components/ui/alert-dialog/AlertDialog.vue
rename to resources/js/components/ui/alert-dialog/AlertDialog.vue
diff --git a/resources/js/Components/ui/alert-dialog/AlertDialogAction.vue b/resources/js/components/ui/alert-dialog/AlertDialogAction.vue
similarity index 100%
rename from resources/js/Components/ui/alert-dialog/AlertDialogAction.vue
rename to resources/js/components/ui/alert-dialog/AlertDialogAction.vue
diff --git a/resources/js/Components/ui/alert-dialog/AlertDialogCancel.vue b/resources/js/components/ui/alert-dialog/AlertDialogCancel.vue
similarity index 100%
rename from resources/js/Components/ui/alert-dialog/AlertDialogCancel.vue
rename to resources/js/components/ui/alert-dialog/AlertDialogCancel.vue
diff --git a/resources/js/Components/ui/alert-dialog/AlertDialogContent.vue b/resources/js/components/ui/alert-dialog/AlertDialogContent.vue
similarity index 100%
rename from resources/js/Components/ui/alert-dialog/AlertDialogContent.vue
rename to resources/js/components/ui/alert-dialog/AlertDialogContent.vue
diff --git a/resources/js/Components/ui/alert-dialog/AlertDialogDescription.vue b/resources/js/components/ui/alert-dialog/AlertDialogDescription.vue
similarity index 100%
rename from resources/js/Components/ui/alert-dialog/AlertDialogDescription.vue
rename to resources/js/components/ui/alert-dialog/AlertDialogDescription.vue
diff --git a/resources/js/Components/ui/alert-dialog/AlertDialogFooter.vue b/resources/js/components/ui/alert-dialog/AlertDialogFooter.vue
similarity index 100%
rename from resources/js/Components/ui/alert-dialog/AlertDialogFooter.vue
rename to resources/js/components/ui/alert-dialog/AlertDialogFooter.vue
diff --git a/resources/js/Components/ui/alert-dialog/AlertDialogHeader.vue b/resources/js/components/ui/alert-dialog/AlertDialogHeader.vue
similarity index 100%
rename from resources/js/Components/ui/alert-dialog/AlertDialogHeader.vue
rename to resources/js/components/ui/alert-dialog/AlertDialogHeader.vue
diff --git a/resources/js/Components/ui/alert-dialog/AlertDialogTitle.vue b/resources/js/components/ui/alert-dialog/AlertDialogTitle.vue
similarity index 100%
rename from resources/js/Components/ui/alert-dialog/AlertDialogTitle.vue
rename to resources/js/components/ui/alert-dialog/AlertDialogTitle.vue
diff --git a/resources/js/Components/ui/alert-dialog/AlertDialogTrigger.vue b/resources/js/components/ui/alert-dialog/AlertDialogTrigger.vue
similarity index 100%
rename from resources/js/Components/ui/alert-dialog/AlertDialogTrigger.vue
rename to resources/js/components/ui/alert-dialog/AlertDialogTrigger.vue
diff --git a/resources/js/Components/ui/alert-dialog/index.ts b/resources/js/components/ui/alert-dialog/index.ts
similarity index 100%
rename from resources/js/Components/ui/alert-dialog/index.ts
rename to resources/js/components/ui/alert-dialog/index.ts
diff --git a/resources/js/Components/ui/badge/Badge.vue b/resources/js/components/ui/badge/Badge.vue
similarity index 100%
rename from resources/js/Components/ui/badge/Badge.vue
rename to resources/js/components/ui/badge/Badge.vue
diff --git a/resources/js/Components/ui/badge/index.ts b/resources/js/components/ui/badge/index.ts
similarity index 100%
rename from resources/js/Components/ui/badge/index.ts
rename to resources/js/components/ui/badge/index.ts
diff --git a/resources/js/Components/ui/breadcrumb/Breadcrumb.vue b/resources/js/components/ui/breadcrumb/Breadcrumb.vue
similarity index 100%
rename from resources/js/Components/ui/breadcrumb/Breadcrumb.vue
rename to resources/js/components/ui/breadcrumb/Breadcrumb.vue
diff --git a/resources/js/Components/ui/breadcrumb/BreadcrumbEllipsis.vue b/resources/js/components/ui/breadcrumb/BreadcrumbEllipsis.vue
similarity index 100%
rename from resources/js/Components/ui/breadcrumb/BreadcrumbEllipsis.vue
rename to resources/js/components/ui/breadcrumb/BreadcrumbEllipsis.vue
diff --git a/resources/js/Components/ui/breadcrumb/BreadcrumbItem.vue b/resources/js/components/ui/breadcrumb/BreadcrumbItem.vue
similarity index 100%
rename from resources/js/Components/ui/breadcrumb/BreadcrumbItem.vue
rename to resources/js/components/ui/breadcrumb/BreadcrumbItem.vue
diff --git a/resources/js/Components/ui/breadcrumb/BreadcrumbLink.vue b/resources/js/components/ui/breadcrumb/BreadcrumbLink.vue
similarity index 100%
rename from resources/js/Components/ui/breadcrumb/BreadcrumbLink.vue
rename to resources/js/components/ui/breadcrumb/BreadcrumbLink.vue
diff --git a/resources/js/Components/ui/breadcrumb/BreadcrumbList.vue b/resources/js/components/ui/breadcrumb/BreadcrumbList.vue
similarity index 100%
rename from resources/js/Components/ui/breadcrumb/BreadcrumbList.vue
rename to resources/js/components/ui/breadcrumb/BreadcrumbList.vue
diff --git a/resources/js/Components/ui/breadcrumb/BreadcrumbPage.vue b/resources/js/components/ui/breadcrumb/BreadcrumbPage.vue
similarity index 100%
rename from resources/js/Components/ui/breadcrumb/BreadcrumbPage.vue
rename to resources/js/components/ui/breadcrumb/BreadcrumbPage.vue
diff --git a/resources/js/Components/ui/breadcrumb/BreadcrumbSeparator.vue b/resources/js/components/ui/breadcrumb/BreadcrumbSeparator.vue
similarity index 100%
rename from resources/js/Components/ui/breadcrumb/BreadcrumbSeparator.vue
rename to resources/js/components/ui/breadcrumb/BreadcrumbSeparator.vue
diff --git a/resources/js/Components/ui/breadcrumb/index.ts b/resources/js/components/ui/breadcrumb/index.ts
similarity index 100%
rename from resources/js/Components/ui/breadcrumb/index.ts
rename to resources/js/components/ui/breadcrumb/index.ts
diff --git a/resources/js/Components/ui/button/Button.vue b/resources/js/components/ui/button/Button.vue
similarity index 100%
rename from resources/js/Components/ui/button/Button.vue
rename to resources/js/components/ui/button/Button.vue
diff --git a/resources/js/Components/ui/button/index.ts b/resources/js/components/ui/button/index.ts
similarity index 100%
rename from resources/js/Components/ui/button/index.ts
rename to resources/js/components/ui/button/index.ts
diff --git a/resources/js/Components/ui/calendar/Calendar.vue b/resources/js/components/ui/calendar/Calendar.vue
similarity index 100%
rename from resources/js/Components/ui/calendar/Calendar.vue
rename to resources/js/components/ui/calendar/Calendar.vue
diff --git a/resources/js/Components/ui/calendar/CalendarCell.vue b/resources/js/components/ui/calendar/CalendarCell.vue
similarity index 100%
rename from resources/js/Components/ui/calendar/CalendarCell.vue
rename to resources/js/components/ui/calendar/CalendarCell.vue
diff --git a/resources/js/Components/ui/calendar/CalendarCellTrigger.vue b/resources/js/components/ui/calendar/CalendarCellTrigger.vue
similarity index 96%
rename from resources/js/Components/ui/calendar/CalendarCellTrigger.vue
rename to resources/js/components/ui/calendar/CalendarCellTrigger.vue
index 7527345..386072f 100644
--- a/resources/js/Components/ui/calendar/CalendarCellTrigger.vue
+++ b/resources/js/components/ui/calendar/CalendarCellTrigger.vue
@@ -1,7 +1,7 @@