Skip to content
Snippets Groups Projects
Commit 609bec7a authored by Antoine Gaudron-Desjardins's avatar Antoine Gaudron-Desjardins
Browse files

linting

parent 26709f86
No related branches found
No related tags found
1 merge request!39auth
Pipeline #44140 passed
......@@ -183,7 +183,18 @@ def get_comments(place: str, page: int, db: Session):
if page == 0:
comments = db.query(models.Comments).order_by(models.Comments.published_at.desc(), models.Comments.id.desc()).all()
else:
comments = db.query(models.Comments, models.Users.username).join(models.Users).filter(models.Comments.place == place).order_by(models.Comments.published_at.desc(), models.Comments.id.desc()).slice((page - 1) * 20, page * 20).all()
comments = db.query(
models.Comments,
models.Users.username).join(
models.Users).filter(
models.Comments.place == place).order_by(
models.Comments.published_at.desc(),
models.Comments.id.desc()).slice(
(page -
1) *
20,
page *
20).all()
return list(schemas.Comment(**comment.__dict__, username=username) for comment, username in comments)
......
......@@ -152,7 +152,9 @@ export default function Messages({ place, infos }) {
let [year, month, day] = date.split("-");
return (
<div key={index} className="comment">
<div className={`comment-title${infos ? "-infos" : ""}`}>{infos ? message.title : message.username}</div>
<div className={`comment-title${infos ? "-infos" : ""}`}>
{infos ? message.title : message.username}
</div>
<div className="comment-content">{message.content}</div>
<div className="comment-date">
{${hour.substring(0, 5)} le ${day}/${month}/${year}`}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment