Skip to content

Commit cabe6cd

Browse files
committed
Forgot to rename two fields
1 parent 90ca53b commit cabe6cd

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

backend/PyMatcha/models/message.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -68,11 +68,11 @@ def create(
6868

6969
def to_dict(self) -> Dict:
7070
returned_dict = super().to_dict()
71-
returned_dict["timestamp_ago"] = timeago_format(self.timestamp, datetime.utcnow())
72-
if self.seen_timestamp:
73-
returned_dict["seen_timestamp_ago"] = timeago_format(self.seen_timestamp, datetime.utcnow())
71+
returned_dict["dt_sent_ago"] = timeago_format(self.dt_sent, datetime.utcnow())
72+
if self.dt_seen:
73+
returned_dict["dt_seen_ago"] = timeago_format(self.dt_seen, datetime.utcnow())
7474
else:
75-
returned_dict["seen_timestamp_ago"] = None
75+
returned_dict["dt_seen_ago"] = None
7676

7777
return returned_dict
7878

backend/PyMatcha/routes/api/messages.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,8 @@ def get_opened_conversations():
4848
returned_list = [
4949
{
5050
"last_message_id": c.id,
51-
"last_message_timestamp": c.dt_sent,
52-
"last_message_timestamp_ago": timeago_format(c.dt_sent, datetime.datetime.utcnow()),
51+
"last_message_dt_sent": c.dt_sent,
52+
"last_message_dt_sent_ago": timeago_format(c.dt_sent, datetime.datetime.utcnow()),
5353
"last_message_content": c.content,
5454
"is_unseen": True if not c.is_seen and c.to_id == current_user.id else False,
5555
"with_user": get_user(c.to_id if c.to_id != current_user.id else c.from_id).to_dict(),

0 commit comments

Comments
 (0)