Compare commits

..

No commits in common. "feat/swagger" and "master" have entirely different histories.

22 changed files with 46 additions and 1333 deletions

View File

@ -1,13 +1,7 @@
import type { NextConfig } from "next";
const nextConfig: NextConfig = {
experimental: {
appDir: true, // tu las sûrement déjà
// 👇 on active le support de pages (cohabitation possible)
legacyBrowsers: false, // (optionnel mais conseillé)
},
// 👇 important si tu as déplacé dans /src
pageExtensions: ['js', 'jsx', 'ts', 'tsx'],
/* config options here */
};
export default nextConfig;

950
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -11,13 +11,9 @@
"dependencies": {
"@prisma/client": "^6.6.0",
"next": "15.3.0",
"next-swagger-doc": "^0.4.1",
"prisma": "^6.6.0",
"react": "^19.0.0",
"react-dom": "^19.0.0",
"swagger-jsdoc": "^6.2.8",
"swagger-ui-express": "^5.0.1",
"yarn": "^1.22.22"
"react-dom": "^19.0.0"
},
"devDependencies": {
"@eslint/eslintrc": "^3",
@ -25,7 +21,6 @@
"@types/node": "^20",
"@types/react": "^19",
"@types/react-dom": "^19",
"@types/swagger-ui-react": "^5.18.0",
"eslint": "^9",
"eslint-config-next": "15.3.0",
"tailwindcss": "^4",

View File

@ -42,7 +42,6 @@ model Formation {
fo_miniature Bytes?
fo_teaser String?
fo_date_publication DateTime @default(now())
fo_desactive Boolean @default(false)
fo_video Video[]
commandeFormation CommandeFormation[]
achat Achat[]

View File

@ -1,34 +0,0 @@
import { NextResponse } from "next/server";
import { getAchatById } from "@/methods/achatMethods";
/**
* @swagger
* /api/achats/{id}:
* get:
* tags :
* - achats
* summary: Filtre les achats avec l'identifiant de l'utilisateur
* description: Filtre sur l'identifiant de l'utilisateur
* parameters:
* - in: path
* name: id
* required: true
* schema:
* type: string
* description: ID de l'utilisateur
* responses:
* 200:
* description: Retourn les achats de l'utilisateur
*/
export async function GET(
request: Request,
context: { params: { id: string } }
) {
const { id } = context.params
const result = await getAchatById(id)
return NextResponse.json(result, { status: 200 })
}

View File

@ -2,32 +2,6 @@ import { NextResponse } from 'next/server'
import { createAchat,getAllAchat } from '@/methods/achatMethods'
/**
* @swagger
* /api/achats:
* post:
* tags:
* - achats
* summary: Crée un achat
* requestBody:
* required: true
* content:
* application/json:
* schema:
* type: object
* properties:
* idUtilisateur:
* type: integer
* idFormation:
* type: integer
* required:
* - idUtilisateur
* - idFormation
* responses:
* 201:
* description: achat créé
*/
export async function POST(request: Request) {
const body = await request.json()
const{idUtilisateur,idFormation} = body
@ -36,19 +10,6 @@ export async function POST(request: Request) {
return NextResponse.json(result, { status: 201 })
}
/**
* @swagger
* /api/achats:
* get:
* tags :
* - achats
* summary: Lister les achats
* description: Retourne l'ensemble des achats
* responses:
* 200:
* description: liste des achats
*/
export async function GET(){
const result = await getAllAchat()
return NextResponse.json(result, { status: 200 })

View File

@ -2,35 +2,6 @@ import { NextResponse } from 'next/server'
import { createFormation,deleteFormation,getAllFormation } from '@/methods/formationMethods'
/**
* @swagger
* /api/formations:
* post:
* tags:
* - formations
* summary: Crée une formations
* requestBody:
* required: true
* content:
* application/json:
* schema:
* type: object
* properties:
* titre:
* type: string
* description:
* type: string
* prix :
* type : string
* required:
* - titre
* - description
* - prix
* responses:
* 201:
* description: formation créé
*/
export async function POST(request: Request) {
const body = await request.json()
const{titre,description,prix} = body
@ -39,48 +10,11 @@ export async function POST(request: Request) {
return NextResponse.json(result, { status: 201 })
}
/**
* @swagger
* /api/formations:
* get:
* tags :
* - formations
* summary: Lister toutes les formations
* description: Retourne l'ensemble des formations
* responses:
* 200:
* description: liste des formations
*/
export async function GET(){
const result = await getAllFormation()
return NextResponse.json(result, { status: 200 })
}
/**
* @swagger
* /api/formations:
* delete:
* tags :
* - formations
* summary: delete une formations
* description: delete une formations
* requestBody:
* required: true
* content:
* application/json:
* schema:
* type: object
* properties:
* id:
* type: number
* required:
* - id
* responses:
* 200:
* description: liste des formations
*/
export async function DELETE(request : Request){
const body = await request.json()
const {id } = body

View File

@ -1,7 +0,0 @@
import swaggerSpec from '@/lib/swaggerConfig';
export async function GET() {
return Response.json(swaggerSpec);
}

View File

@ -4,36 +4,6 @@ import { createUserMethod,deleteUser,getAllUser } from '@/methods/userMethods'
/**
* @swagger
* /api/users:
* post:
* tags:
* - utilisateurs
* summary: Crée un utilisateur
* requestBody:
* required: true
* content:
* application/json:
* schema:
* type: object
* properties:
* name:
* type: string
* prenom:
* type: string
* email:
* type: string
* required:
* - name
* - prenom
* - email
* responses:
* 201:
* description: utilisateur créé
*/
export async function POST(request: Request) {
const body = await request.json()
const { name, prenom,email } = body
@ -47,48 +17,13 @@ export async function POST(request: Request) {
}
/**
* @swagger
* /api/users:
* get:
* tags :
* - utilisateurs
* summary: Lister les utilisateurs
* description: Retourne l'ensemble des utilisateurs
* responses:
* 200:
* description: liste des utilisateurs
*/
export async function GET() {
const user = await getAllUser()
return NextResponse.json(user, { status: 200 })
}
/**
* @swagger
* /api/users:
* delete:
* tags :
* - utilisateurs
* summary: delete un utilisateur
* description: delete un utilisateur
* requestBody:
* required: true
* content:
* application/json:
* schema:
* type: object
* properties:
* id:
* type: number
* required:
* - id
* responses:
* 200:
* description: suppression de l'utilisateur
*/
export async function DELETE(request : Request){
const param = await request.json()

View File

@ -1,35 +1,6 @@
import { NextResponse } from 'next/server'
import { createVideo, getAllVideo} from '@/methods/videoMethods'
/**
* @swagger
* /api/videos:
* post:
* tags:
* - videos
* summary: Crée une videos
* requestBody:
* required: true
* content:
* application/json:
* schema:
* type: object
* properties:
* idForm:
* type: interger
* titre:
* type: string
* description :
* type : string
* required:
* - titre
* - idForm
* - prix
* responses:
* 201:
* description: formation créé
*/
export async function POST(request: Request) {
const body = await request.json()
const{idForm,titre,description} = body
@ -38,20 +9,6 @@ export async function POST(request: Request) {
return NextResponse.json(result, { status: 201 })
}
/**
* @swagger
* /api/videos:
* get:
* tags :
* - videos
* summary: Lister les videos
* description: Retourne l'ensemble des videos
* responses:
* 200:
* description: liste des videos
*/
export async function GET(){
const result = await getAllVideo()
return NextResponse.json(result,{status : 200})

View File

@ -1,12 +0,0 @@
'use client';
import SwaggerUI from 'swagger-ui-react';
import 'swagger-ui-react/swagger-ui.css';
export default function SwaggerPage() {
return (
<div style={{ height: '100vh' }}>
<SwaggerUI url="/api/swagger" />
</div>
);
}

File diff suppressed because one or more lines are too long

View File

@ -142,8 +142,7 @@ exports.Prisma.FormationScalarFieldEnum = {
fo_prix: 'fo_prix',
fo_miniature: 'fo_miniature',
fo_teaser: 'fo_teaser',
fo_date_publication: 'fo_date_publication',
fo_desactive: 'fo_desactive'
fo_date_publication: 'fo_date_publication'
};
exports.Prisma.VideoScalarFieldEnum = {

View File

@ -2779,7 +2779,6 @@ export namespace Prisma {
fo_miniature: Uint8Array | null
fo_teaser: string | null
fo_date_publication: Date | null
fo_desactive: boolean | null
}
export type FormationMaxAggregateOutputType = {
@ -2790,7 +2789,6 @@ export namespace Prisma {
fo_miniature: Uint8Array | null
fo_teaser: string | null
fo_date_publication: Date | null
fo_desactive: boolean | null
}
export type FormationCountAggregateOutputType = {
@ -2801,7 +2799,6 @@ export namespace Prisma {
fo_miniature: number
fo_teaser: number
fo_date_publication: number
fo_desactive: number
_all: number
}
@ -2822,7 +2819,6 @@ export namespace Prisma {
fo_miniature?: true
fo_teaser?: true
fo_date_publication?: true
fo_desactive?: true
}
export type FormationMaxAggregateInputType = {
@ -2833,7 +2829,6 @@ export namespace Prisma {
fo_miniature?: true
fo_teaser?: true
fo_date_publication?: true
fo_desactive?: true
}
export type FormationCountAggregateInputType = {
@ -2844,7 +2839,6 @@ export namespace Prisma {
fo_miniature?: true
fo_teaser?: true
fo_date_publication?: true
fo_desactive?: true
_all?: true
}
@ -2942,7 +2936,6 @@ export namespace Prisma {
fo_miniature: Uint8Array | null
fo_teaser: string | null
fo_date_publication: Date
fo_desactive: boolean
_count: FormationCountAggregateOutputType | null
_avg: FormationAvgAggregateOutputType | null
_sum: FormationSumAggregateOutputType | null
@ -2972,7 +2965,6 @@ export namespace Prisma {
fo_miniature?: boolean
fo_teaser?: boolean
fo_date_publication?: boolean
fo_desactive?: boolean
fo_video?: boolean | Formation$fo_videoArgs<ExtArgs>
commandeFormation?: boolean | Formation$commandeFormationArgs<ExtArgs>
achat?: boolean | Formation$achatArgs<ExtArgs>
@ -2989,10 +2981,9 @@ export namespace Prisma {
fo_miniature?: boolean
fo_teaser?: boolean
fo_date_publication?: boolean
fo_desactive?: boolean
}
export type FormationOmit<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = $Extensions.GetOmit<"fo_id" | "fo_titre" | "fo_description" | "fo_prix" | "fo_miniature" | "fo_teaser" | "fo_date_publication" | "fo_desactive", ExtArgs["result"]["formation"]>
export type FormationOmit<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = $Extensions.GetOmit<"fo_id" | "fo_titre" | "fo_description" | "fo_prix" | "fo_miniature" | "fo_teaser" | "fo_date_publication", ExtArgs["result"]["formation"]>
export type FormationInclude<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
fo_video?: boolean | Formation$fo_videoArgs<ExtArgs>
commandeFormation?: boolean | Formation$commandeFormationArgs<ExtArgs>
@ -3015,7 +3006,6 @@ export namespace Prisma {
fo_miniature: Uint8Array | null
fo_teaser: string | null
fo_date_publication: Date
fo_desactive: boolean
}, ExtArgs["result"]["formation"]>
composites: {}
}
@ -3395,7 +3385,6 @@ export namespace Prisma {
readonly fo_miniature: FieldRef<"Formation", 'Bytes'>
readonly fo_teaser: FieldRef<"Formation", 'String'>
readonly fo_date_publication: FieldRef<"Formation", 'DateTime'>
readonly fo_desactive: FieldRef<"Formation", 'Boolean'>
}
@ -9664,8 +9653,7 @@ export namespace Prisma {
fo_prix: 'fo_prix',
fo_miniature: 'fo_miniature',
fo_teaser: 'fo_teaser',
fo_date_publication: 'fo_date_publication',
fo_desactive: 'fo_desactive'
fo_date_publication: 'fo_date_publication'
};
export type FormationScalarFieldEnum = (typeof FormationScalarFieldEnum)[keyof typeof FormationScalarFieldEnum]
@ -9828,13 +9816,6 @@ export namespace Prisma {
/**
* Reference to a field of type 'Boolean'
*/
export type BooleanFieldRefInput<$PrismaModel> = FieldRefInputType<$PrismaModel, 'Boolean'>
/**
* Reference to a field of type 'Float'
*/
@ -9967,7 +9948,6 @@ export namespace Prisma {
fo_miniature?: BytesNullableFilter<"Formation"> | Uint8Array | null
fo_teaser?: StringNullableFilter<"Formation"> | string | null
fo_date_publication?: DateTimeFilter<"Formation"> | Date | string
fo_desactive?: BoolFilter<"Formation"> | boolean
fo_video?: VideoListRelationFilter
commandeFormation?: CommandeFormationListRelationFilter
achat?: AchatListRelationFilter
@ -9981,7 +9961,6 @@ export namespace Prisma {
fo_miniature?: SortOrderInput | SortOrder
fo_teaser?: SortOrderInput | SortOrder
fo_date_publication?: SortOrder
fo_desactive?: SortOrder
fo_video?: VideoOrderByRelationAggregateInput
commandeFormation?: CommandeFormationOrderByRelationAggregateInput
achat?: AchatOrderByRelationAggregateInput
@ -9999,7 +9978,6 @@ export namespace Prisma {
fo_miniature?: BytesNullableFilter<"Formation"> | Uint8Array | null
fo_teaser?: StringNullableFilter<"Formation"> | string | null
fo_date_publication?: DateTimeFilter<"Formation"> | Date | string
fo_desactive?: BoolFilter<"Formation"> | boolean
fo_video?: VideoListRelationFilter
commandeFormation?: CommandeFormationListRelationFilter
achat?: AchatListRelationFilter
@ -10013,7 +9991,6 @@ export namespace Prisma {
fo_miniature?: SortOrderInput | SortOrder
fo_teaser?: SortOrderInput | SortOrder
fo_date_publication?: SortOrder
fo_desactive?: SortOrder
_count?: FormationCountOrderByAggregateInput
_avg?: FormationAvgOrderByAggregateInput
_max?: FormationMaxOrderByAggregateInput
@ -10032,7 +10009,6 @@ export namespace Prisma {
fo_miniature?: BytesNullableWithAggregatesFilter<"Formation"> | Uint8Array | null
fo_teaser?: StringNullableWithAggregatesFilter<"Formation"> | string | null
fo_date_publication?: DateTimeWithAggregatesFilter<"Formation"> | Date | string
fo_desactive?: BoolWithAggregatesFilter<"Formation"> | boolean
}
export type VideoWhereInput = {
@ -10494,7 +10470,6 @@ export namespace Prisma {
fo_miniature?: Uint8Array | null
fo_teaser?: string | null
fo_date_publication?: Date | string
fo_desactive?: boolean
fo_video?: VideoCreateNestedManyWithoutFormationInput
commandeFormation?: CommandeFormationCreateNestedManyWithoutFormationInput
achat?: AchatCreateNestedManyWithoutFormationInput
@ -10508,7 +10483,6 @@ export namespace Prisma {
fo_miniature?: Uint8Array | null
fo_teaser?: string | null
fo_date_publication?: Date | string
fo_desactive?: boolean
fo_video?: VideoUncheckedCreateNestedManyWithoutFormationInput
commandeFormation?: CommandeFormationUncheckedCreateNestedManyWithoutFormationInput
achat?: AchatUncheckedCreateNestedManyWithoutFormationInput
@ -10521,7 +10495,6 @@ export namespace Prisma {
fo_miniature?: NullableBytesFieldUpdateOperationsInput | Uint8Array | null
fo_teaser?: NullableStringFieldUpdateOperationsInput | string | null
fo_date_publication?: DateTimeFieldUpdateOperationsInput | Date | string
fo_desactive?: BoolFieldUpdateOperationsInput | boolean
fo_video?: VideoUpdateManyWithoutFormationNestedInput
commandeFormation?: CommandeFormationUpdateManyWithoutFormationNestedInput
achat?: AchatUpdateManyWithoutFormationNestedInput
@ -10535,7 +10508,6 @@ export namespace Prisma {
fo_miniature?: NullableBytesFieldUpdateOperationsInput | Uint8Array | null
fo_teaser?: NullableStringFieldUpdateOperationsInput | string | null
fo_date_publication?: DateTimeFieldUpdateOperationsInput | Date | string
fo_desactive?: BoolFieldUpdateOperationsInput | boolean
fo_video?: VideoUncheckedUpdateManyWithoutFormationNestedInput
commandeFormation?: CommandeFormationUncheckedUpdateManyWithoutFormationNestedInput
achat?: AchatUncheckedUpdateManyWithoutFormationNestedInput
@ -10549,7 +10521,6 @@ export namespace Prisma {
fo_miniature?: Uint8Array | null
fo_teaser?: string | null
fo_date_publication?: Date | string
fo_desactive?: boolean
}
export type FormationUpdateManyMutationInput = {
@ -10559,7 +10530,6 @@ export namespace Prisma {
fo_miniature?: NullableBytesFieldUpdateOperationsInput | Uint8Array | null
fo_teaser?: NullableStringFieldUpdateOperationsInput | string | null
fo_date_publication?: DateTimeFieldUpdateOperationsInput | Date | string
fo_desactive?: BoolFieldUpdateOperationsInput | boolean
}
export type FormationUncheckedUpdateManyInput = {
@ -10570,7 +10540,6 @@ export namespace Prisma {
fo_miniature?: NullableBytesFieldUpdateOperationsInput | Uint8Array | null
fo_teaser?: NullableStringFieldUpdateOperationsInput | string | null
fo_date_publication?: DateTimeFieldUpdateOperationsInput | Date | string
fo_desactive?: BoolFieldUpdateOperationsInput | boolean
}
export type VideoCreateInput = {
@ -11101,11 +11070,6 @@ export namespace Prisma {
not?: NestedBytesNullableFilter<$PrismaModel> | Uint8Array | null
}
export type BoolFilter<$PrismaModel = never> = {
equals?: boolean | BooleanFieldRefInput<$PrismaModel>
not?: NestedBoolFilter<$PrismaModel> | boolean
}
export type VideoListRelationFilter = {
every?: VideoWhereInput
some?: VideoWhereInput
@ -11140,7 +11104,6 @@ export namespace Prisma {
fo_miniature?: SortOrder
fo_teaser?: SortOrder
fo_date_publication?: SortOrder
fo_desactive?: SortOrder
}
export type FormationAvgOrderByAggregateInput = {
@ -11155,7 +11118,6 @@ export namespace Prisma {
fo_miniature?: SortOrder
fo_teaser?: SortOrder
fo_date_publication?: SortOrder
fo_desactive?: SortOrder
}
export type FormationMinOrderByAggregateInput = {
@ -11166,7 +11128,6 @@ export namespace Prisma {
fo_miniature?: SortOrder
fo_teaser?: SortOrder
fo_date_publication?: SortOrder
fo_desactive?: SortOrder
}
export type FormationSumOrderByAggregateInput = {
@ -11183,14 +11144,6 @@ export namespace Prisma {
_max?: NestedBytesNullableFilter<$PrismaModel>
}
export type BoolWithAggregatesFilter<$PrismaModel = never> = {
equals?: boolean | BooleanFieldRefInput<$PrismaModel>
not?: NestedBoolWithAggregatesFilter<$PrismaModel> | boolean
_count?: NestedIntFilter<$PrismaModel>
_min?: NestedBoolFilter<$PrismaModel>
_max?: NestedBoolFilter<$PrismaModel>
}
export type FormationScalarRelationFilter = {
is?: FormationWhereInput
isNot?: FormationWhereInput
@ -11626,10 +11579,6 @@ export namespace Prisma {
set?: Uint8Array | null
}
export type BoolFieldUpdateOperationsInput = {
set?: boolean
}
export type VideoUpdateManyWithoutFormationNestedInput = {
create?: XOR<VideoCreateWithoutFormationInput, VideoUncheckedCreateWithoutFormationInput> | VideoCreateWithoutFormationInput[] | VideoUncheckedCreateWithoutFormationInput[]
connectOrCreate?: VideoCreateOrConnectWithoutFormationInput | VideoCreateOrConnectWithoutFormationInput[]
@ -12066,11 +12015,6 @@ export namespace Prisma {
not?: NestedBytesNullableFilter<$PrismaModel> | Uint8Array | null
}
export type NestedBoolFilter<$PrismaModel = never> = {
equals?: boolean | BooleanFieldRefInput<$PrismaModel>
not?: NestedBoolFilter<$PrismaModel> | boolean
}
export type NestedBytesNullableWithAggregatesFilter<$PrismaModel = never> = {
equals?: Uint8Array | BytesFieldRefInput<$PrismaModel> | null
in?: Uint8Array[] | null
@ -12081,14 +12025,6 @@ export namespace Prisma {
_max?: NestedBytesNullableFilter<$PrismaModel>
}
export type NestedBoolWithAggregatesFilter<$PrismaModel = never> = {
equals?: boolean | BooleanFieldRefInput<$PrismaModel>
not?: NestedBoolWithAggregatesFilter<$PrismaModel> | boolean
_count?: NestedIntFilter<$PrismaModel>
_min?: NestedBoolFilter<$PrismaModel>
_max?: NestedBoolFilter<$PrismaModel>
}
export type NestedStringFilter<$PrismaModel = never> = {
equals?: string | StringFieldRefInput<$PrismaModel>
in?: string[]
@ -12370,7 +12306,6 @@ export namespace Prisma {
fo_miniature?: Uint8Array | null
fo_teaser?: string | null
fo_date_publication?: Date | string
fo_desactive?: boolean
commandeFormation?: CommandeFormationCreateNestedManyWithoutFormationInput
achat?: AchatCreateNestedManyWithoutFormationInput
}
@ -12383,7 +12318,6 @@ export namespace Prisma {
fo_miniature?: Uint8Array | null
fo_teaser?: string | null
fo_date_publication?: Date | string
fo_desactive?: boolean
commandeFormation?: CommandeFormationUncheckedCreateNestedManyWithoutFormationInput
achat?: AchatUncheckedCreateNestedManyWithoutFormationInput
}
@ -12429,7 +12363,6 @@ export namespace Prisma {
fo_miniature?: NullableBytesFieldUpdateOperationsInput | Uint8Array | null
fo_teaser?: NullableStringFieldUpdateOperationsInput | string | null
fo_date_publication?: DateTimeFieldUpdateOperationsInput | Date | string
fo_desactive?: BoolFieldUpdateOperationsInput | boolean
commandeFormation?: CommandeFormationUpdateManyWithoutFormationNestedInput
achat?: AchatUpdateManyWithoutFormationNestedInput
}
@ -12442,7 +12375,6 @@ export namespace Prisma {
fo_miniature?: NullableBytesFieldUpdateOperationsInput | Uint8Array | null
fo_teaser?: NullableStringFieldUpdateOperationsInput | string | null
fo_date_publication?: DateTimeFieldUpdateOperationsInput | Date | string
fo_desactive?: BoolFieldUpdateOperationsInput | boolean
commandeFormation?: CommandeFormationUncheckedUpdateManyWithoutFormationNestedInput
achat?: AchatUncheckedUpdateManyWithoutFormationNestedInput
}
@ -12568,7 +12500,6 @@ export namespace Prisma {
fo_miniature?: Uint8Array | null
fo_teaser?: string | null
fo_date_publication?: Date | string
fo_desactive?: boolean
fo_video?: VideoCreateNestedManyWithoutFormationInput
achat?: AchatCreateNestedManyWithoutFormationInput
}
@ -12581,7 +12512,6 @@ export namespace Prisma {
fo_miniature?: Uint8Array | null
fo_teaser?: string | null
fo_date_publication?: Date | string
fo_desactive?: boolean
fo_video?: VideoUncheckedCreateNestedManyWithoutFormationInput
achat?: AchatUncheckedCreateNestedManyWithoutFormationInput
}
@ -12609,7 +12539,6 @@ export namespace Prisma {
fo_miniature?: NullableBytesFieldUpdateOperationsInput | Uint8Array | null
fo_teaser?: NullableStringFieldUpdateOperationsInput | string | null
fo_date_publication?: DateTimeFieldUpdateOperationsInput | Date | string
fo_desactive?: BoolFieldUpdateOperationsInput | boolean
fo_video?: VideoUpdateManyWithoutFormationNestedInput
achat?: AchatUpdateManyWithoutFormationNestedInput
}
@ -12622,7 +12551,6 @@ export namespace Prisma {
fo_miniature?: NullableBytesFieldUpdateOperationsInput | Uint8Array | null
fo_teaser?: NullableStringFieldUpdateOperationsInput | string | null
fo_date_publication?: DateTimeFieldUpdateOperationsInput | Date | string
fo_desactive?: BoolFieldUpdateOperationsInput | boolean
fo_video?: VideoUncheckedUpdateManyWithoutFormationNestedInput
achat?: AchatUncheckedUpdateManyWithoutFormationNestedInput
}
@ -12676,7 +12604,6 @@ export namespace Prisma {
fo_miniature?: Uint8Array | null
fo_teaser?: string | null
fo_date_publication?: Date | string
fo_desactive?: boolean
fo_video?: VideoCreateNestedManyWithoutFormationInput
commandeFormation?: CommandeFormationCreateNestedManyWithoutFormationInput
}
@ -12689,7 +12616,6 @@ export namespace Prisma {
fo_miniature?: Uint8Array | null
fo_teaser?: string | null
fo_date_publication?: Date | string
fo_desactive?: boolean
fo_video?: VideoUncheckedCreateNestedManyWithoutFormationInput
commandeFormation?: CommandeFormationUncheckedCreateNestedManyWithoutFormationInput
}
@ -12765,7 +12691,6 @@ export namespace Prisma {
fo_miniature?: NullableBytesFieldUpdateOperationsInput | Uint8Array | null
fo_teaser?: NullableStringFieldUpdateOperationsInput | string | null
fo_date_publication?: DateTimeFieldUpdateOperationsInput | Date | string
fo_desactive?: BoolFieldUpdateOperationsInput | boolean
fo_video?: VideoUpdateManyWithoutFormationNestedInput
commandeFormation?: CommandeFormationUpdateManyWithoutFormationNestedInput
}
@ -12778,7 +12703,6 @@ export namespace Prisma {
fo_miniature?: NullableBytesFieldUpdateOperationsInput | Uint8Array | null
fo_teaser?: NullableStringFieldUpdateOperationsInput | string | null
fo_date_publication?: DateTimeFieldUpdateOperationsInput | Date | string
fo_desactive?: BoolFieldUpdateOperationsInput | boolean
fo_video?: VideoUncheckedUpdateManyWithoutFormationNestedInput
commandeFormation?: CommandeFormationUncheckedUpdateManyWithoutFormationNestedInput
}

File diff suppressed because one or more lines are too long

View File

@ -1,5 +1,5 @@
{
"name": "prisma-client-92cb5c5a904849943d80d941f6ca4ba7ca32ac58daa69f6474ab463b839afab2",
"name": "prisma-client-122a4d41568f65eb65f023f60595462dfeea2d65365357e490376c9300fbddbf",
"main": "index.js",
"types": "index.d.ts",
"browser": "index-browser.js",

View File

@ -42,7 +42,6 @@ model Formation {
fo_miniature Bytes?
fo_teaser String?
fo_date_publication DateTime @default(now())
fo_desactive Boolean @default(false)
fo_video Video[]
commandeFormation CommandeFormation[]
achat Achat[]

View File

@ -142,8 +142,7 @@ exports.Prisma.FormationScalarFieldEnum = {
fo_prix: 'fo_prix',
fo_miniature: 'fo_miniature',
fo_teaser: 'fo_teaser',
fo_date_publication: 'fo_date_publication',
fo_desactive: 'fo_desactive'
fo_date_publication: 'fo_date_publication'
};
exports.Prisma.VideoScalarFieldEnum = {

View File

@ -1,17 +0,0 @@
import swaggerJSDoc from 'swagger-jsdoc';
const options = {
definition: {
openapi: '3.0.0',
info: {
title: 'Mon API',
version: '1.0.0',
},
},
// 👇 Assure-toi davoir le bon chemin, avec .ts si tu es en TypeScript
apis: ['./src/app/api/**/*.ts'],
};
const swaggerSpec = swaggerJSDoc(options);
export default swaggerSpec;

View File

@ -13,16 +13,3 @@ export async function createAchat(idUtilisateur : number, idFormation : number){
export async function getAllAchat(){
return await prisma.achat.findMany()
}
export async function getAchatById( id: string){
return await prisma.achat.findFirst(
{where : {
ac_utilisateur : parseInt(id)
},select : {
ac_formation : true,
ac_date_achat : true,
ac_id : true
}
}
)
}

View File

@ -15,11 +15,7 @@ export async function getAllUser(){
include : {
achat :{
include : {
formation : {
include : {
fo_video : true
}
}
formation : true
}
}
}

View File

@ -22,6 +22,6 @@
"@/*": ["./src/*"]
}
},
"include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", ".next/types/**/*.ts", "src/app/api-doc/react-swagger.js"],
"include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", ".next/types/**/*.ts"],
"exclude": ["node_modules"]
}