Skip to content

Debut des fonctionnaliter de comment#52

Open
devDav65 wants to merge 9 commits into
devfrom
feature/comment
Open

Debut des fonctionnaliter de comment#52
devDav65 wants to merge 9 commits into
devfrom
feature/comment

Conversation

@devDav65

@devDav65 devDav65 commented Apr 8, 2026

Copy link
Copy Markdown
Collaborator

No description provided.

@devDav65 devDav65 requested review from SevTify404 and isaacDMD April 8, 2026 13:34
@devDav65 devDav65 marked this pull request as ready for review April 9, 2026 09:58
@devDav65 devDav65 requested a review from nemesis228ux April 9, 2026 09:59

@SevTify404 SevTify404 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Boffff, on va garder comme çà, tu vas justes ajouter l'iupdate du post quand un commentaire est fait, su post il y'a un attribut comment_count donc tu dois gérer çà aussi du cas au cas

@devDav65 devDav65 requested a review from SevTify404 April 11, 2026 11:25
SevTify404
SevTify404 previously approved these changes Apr 11, 2026

@SevTify404 SevTify404 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

En bref tu dois rajouter plus de vérifications dans tes services

Comment on lines +154 to +158
async def create_comment(
payload: CommentCreate,
reponse: Response,
comment_service: Annotated[CommentService, Depends(get_comment_service)]
) -> Any:

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ici tu dois changer le schema, quand quelqu'un veut créer un commentaire on recup directement son id coté backend, pas depuis le front, faut voir la dépendance get_current_user

Comment thread app/routers/comment_router.py Outdated
Comment on lines +180 to +194
@routeur.delete(
"/{comment_id}",
name="Supprimer un commentaire",
response_model=GlobalStringMessage,
dependencies=[Depends(RoleDepends.only_admin_authorize)]
)
async def delete_comment(
comment_id: Annotated[UUID, Path(description="L'identifiant du commentaire à supprimer")],
reponse: Response,
comment_service: Annotated[CommentService, Depends(get_comment_service)]
) -> Any:
"""Endpoint pour supprimer un commentaire (soft delete)."""
result = await comment_service.service_delete_comment(comment_id=comment_id)
return result.to_HTTP_api_base_response(reponse)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ici au lieu de limiter à only_admin_authorize laisse pluto en public mais tu fais des verification dans le service, du genre tu vérifie si le commentaire appartient à la personne qui veut le supprimer (si c'est un ADMIN tu autorise par défaut)

@devDav65 devDav65 requested a review from SevTify404 April 12, 2026 12:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants