Fix of backend validation problems. #8
@@ -1,4 +1,10 @@
|
||||
import { IsDateString, IsNotEmpty, IsOptional, IsString, MaxLength } from "class-validator";
|
||||
import {
|
||||
IsDateString,
|
||||
IsNotEmpty,
|
||||
IsOptional,
|
||||
IsString,
|
||||
MaxLength,
|
||||
} from "class-validator";
|
||||
|
||||
export class CreateApiKeyDto {
|
||||
@IsString()
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import {
|
||||
IsArray,
|
||||
IsEnum,
|
||||
IsNotEmpty,
|
||||
IsOptional,
|
||||
|
||||
@@ -1,4 +1,10 @@
|
||||
import { IsEnum, IsOptional, IsString, IsUUID, MaxLength } from "class-validator";
|
||||
import {
|
||||
IsEnum,
|
||||
IsOptional,
|
||||
IsString,
|
||||
IsUUID,
|
||||
MaxLength,
|
||||
} from "class-validator";
|
||||
|
||||
export enum ReportReason {
|
||||
INAPPROPRIATE = "inappropriate",
|
||||
|
||||
@@ -2,12 +2,12 @@ import * as React from "react";
|
||||
import { AppSidebar } from "@/components/app-sidebar";
|
||||
import { MobileFilters } from "@/components/mobile-filters";
|
||||
import { SearchSidebar } from "@/components/search-sidebar";
|
||||
import { UserNavMobile } from "@/components/user-nav-mobile";
|
||||
import {
|
||||
SidebarInset,
|
||||
SidebarProvider,
|
||||
SidebarTrigger,
|
||||
} from "@/components/ui/sidebar";
|
||||
import { UserNavMobile } from "@/components/user-nav-mobile";
|
||||
|
||||
export default function DashboardLayout({
|
||||
children,
|
||||
|
||||
@@ -7,12 +7,18 @@ import * as React from "react";
|
||||
import { ContentList } from "@/components/content-list";
|
||||
import { Avatar, AvatarFallback, AvatarImage } from "@/components/ui/avatar";
|
||||
import { Button } from "@/components/ui/button";
|
||||
import { Card, CardContent, CardDescription, CardHeader, CardTitle } from "@/components/ui/card";
|
||||
import {
|
||||
Card,
|
||||
CardContent,
|
||||
CardDescription,
|
||||
CardHeader,
|
||||
CardTitle,
|
||||
} from "@/components/ui/card";
|
||||
import { Spinner } from "@/components/ui/spinner";
|
||||
import { Tabs, TabsContent, TabsList, TabsTrigger } from "@/components/ui/tabs";
|
||||
import { useAuth } from "@/providers/auth-provider";
|
||||
import { ContentService } from "@/services/content.service";
|
||||
import { FavoriteService } from "@/services/favorite.service";
|
||||
import { Spinner } from "@/components/ui/spinner";
|
||||
|
||||
export default function ProfilePage() {
|
||||
const { user, isAuthenticated, isLoading, logout } = useAuth();
|
||||
|
||||
@@ -10,7 +10,13 @@ import { useForm } from "react-hook-form";
|
||||
import { toast } from "sonner";
|
||||
import * as z from "zod";
|
||||
import { Button } from "@/components/ui/button";
|
||||
import { Card, CardContent, CardDescription, CardHeader, CardTitle } from "@/components/ui/card";
|
||||
import {
|
||||
Card,
|
||||
CardContent,
|
||||
CardDescription,
|
||||
CardHeader,
|
||||
CardTitle,
|
||||
} from "@/components/ui/card";
|
||||
import {
|
||||
Form,
|
||||
FormControl,
|
||||
@@ -28,10 +34,10 @@ import {
|
||||
SelectTrigger,
|
||||
SelectValue,
|
||||
} from "@/components/ui/select";
|
||||
import { Spinner } from "@/components/ui/spinner";
|
||||
import { useAuth } from "@/providers/auth-provider";
|
||||
import { CategoryService } from "@/services/category.service";
|
||||
import { ContentService } from "@/services/content.service";
|
||||
import { Spinner } from "@/components/ui/spinner";
|
||||
import type { Category } from "@/types/content";
|
||||
|
||||
const uploadSchema = z.object({
|
||||
|
||||
@@ -159,7 +159,9 @@ export function AppSidebar() {
|
||||
<SidebarMenuItem>
|
||||
<SidebarMenuButton
|
||||
asChild
|
||||
isActive={pathname === "/profile" && searchParams.get("tab") === "favorites"}
|
||||
isActive={
|
||||
pathname === "/profile" && searchParams.get("tab") === "favorites"
|
||||
}
|
||||
tooltip="Mes Favoris"
|
||||
>
|
||||
<Link href="/profile?tab=favorites">
|
||||
@@ -171,7 +173,9 @@ export function AppSidebar() {
|
||||
<SidebarMenuItem>
|
||||
<SidebarMenuButton
|
||||
asChild
|
||||
isActive={pathname === "/profile" && searchParams.get("tab") === "memes"}
|
||||
isActive={
|
||||
pathname === "/profile" && searchParams.get("tab") === "memes"
|
||||
}
|
||||
tooltip="Mes Mèmes"
|
||||
>
|
||||
<Link href="/profile?tab=memes">
|
||||
|
||||
@@ -29,9 +29,7 @@ export function UserNavMobile() {
|
||||
<Link href="/profile">
|
||||
<Avatar className="h-8 w-8 border">
|
||||
<AvatarImage src={user.avatarUrl} alt={user.username} />
|
||||
<AvatarFallback>
|
||||
{user.username.slice(0, 2).toUpperCase()}
|
||||
</AvatarFallback>
|
||||
<AvatarFallback>{user.username.slice(0, 2).toUpperCase()}</AvatarFallback>
|
||||
</Avatar>
|
||||
</Link>
|
||||
</Button>
|
||||
|
||||
Reference in New Issue
Block a user