Skip to content

Commit

Permalink
Merge pull request #251 from Sterbenfr/fix/app
Browse files Browse the repository at this point in the history
fix(app): Fixed multiple things
  • Loading branch information
Aurelienschmi authored Jul 29, 2024
2 parents f0850a6 + 0712b32 commit 778634d
Show file tree
Hide file tree
Showing 12 changed files with 10 additions and 19 deletions.
1 change: 0 additions & 1 deletion app/api/dons/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@ export async function POST(req: NextRequest) {
try {
const query = 'INSERT INTO `Dons` SET ?'
const [rows] = await connection.query(query, dons)
console.log('poulets')
return NextResponse.json(rows)
} catch (error) {
return NextResponse.json(
Expand Down
2 changes: 0 additions & 2 deletions app/api/select/societe/entite/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,9 @@ export async function GET(request: Request) {
return NextResponse.redirect(new URL('/error/not-access', request.url))
}
try {
console.log('Executing query...')
const [rows] = await connection.query(
'SELECT code_entite as id, raison_sociale as label FROM Entite;',
)
console.log('Query result:', rows)
return NextResponse.json(rows)
} catch (err) {
console.error('Error executing query:', err)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,6 @@ export async function POST(req: NextRequest) {
!contact.code_site_suivi ||
!contact.code_utilisateur_suivant
) {
console.log(contact.code_entite)
console.log(contact.code_type_site)
console.log(contact.code_site_suivi)
console.log(contact.code_utilisateur_suivant)
return NextResponse.json(
{ error: 'Missing product data' },
{ status: 400 },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,6 @@ export async function POST(req: NextRequest) {
!contact.code_site_suivi ||
!contact.code_utilisateur_suivant
) {
console.log(contact.code_groupe)
console.log(contact.code_type_de_Site)
console.log(contact.code_site_suivi)
console.log(contact.code_utilisateur_suivant)
return NextResponse.json(
{ error: 'Missing product data' },
{ status: 400 },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,6 @@ function Modalites_livraisonPage({
setFile(event.target.files[0])
}
}

if (
!Array.isArray(modalite_livraison) ||
modalite_livraison.length === 0 ||
Expand Down
2 changes: 1 addition & 1 deletion components/ConfirmPopUp.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ const ConfirmPopUp: React.FC<ConfirmPopUpProps> = ({
onCancel,
}) => {
return (
<div className={style.popUpBackground}>
<div className={`${style.popUpBackground} ${style.z1}`}>
<div className={style.errorPopUp}>
<h2 className={style.NF}>Confirmation:</h2>
<p className={style.CNF}>{message}</p>
Expand Down
2 changes: 1 addition & 1 deletion components/ErrorPopUp.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ interface ErrorPopUpProps {

const ErrorPopUp: React.FC<ErrorPopUpProps> = ({ err }) => {
return (
<div className={style.popUpBackground}>
<div className={`${style.popUpBackground} ${style.z2}`}>
<div className={style.errorPopUp}>
<h2 className={style.NF}>Erreur avec la base de données</h2>
<p className={style.CNF}>{err}</p>
Expand Down
1 change: 0 additions & 1 deletion components/popUp.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,6 @@ const PopUp: React.FC<PopUpProps> = ({
const endpoint = url
let filePath
let file2Path
console.log(file, file2)
if (fileUrl && fileIndex && file !== null) {
const formData = new FormData()
formData.append('image', file as Blob)
Expand Down
1 change: 0 additions & 1 deletion components/searchComponent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ export default function SearchComponent({
)
}
const data = await response.json()
console.log(data)
const formattedOptions = data.map(
(item: { id: string; label: string }) => ({
value: item.id,
Expand Down
1 change: 0 additions & 1 deletion components/select-component.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ export default function SelectComponent({
)
}
const data = await response.json()
console.log(data)
const formattedOptions = data.map(
(item: {
id: string
Expand Down
1 change: 0 additions & 1 deletion components/uploadComponent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ const FileUpload: React.FC<FileUploadProps> = ({ setFile }) => {
const handleFileChange = (e: React.ChangeEvent<HTMLInputElement>) => {
const selectedFile = e.target.files && e.target.files[0]
if (selectedFile) {
console.log('Selected file:', selectedFile)
setFile(selectedFile)
}
}
Expand Down
9 changes: 8 additions & 1 deletion styles/components.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -984,7 +984,6 @@
width: 100vw;
height: 100vh;
background-color: rgba(0, 0, 0, 0.5);
z-index: 1000;
}

.errorPopUp {
Expand All @@ -999,6 +998,14 @@
height: 50%;
}

.z1 {
z-index: 100;
}

.z2 {
z-index: 200;
}

.notLog {
font-weight: bold;
padding: 2rem;
Expand Down

0 comments on commit 778634d

Please sign in to comment.