implement proper timestamps
This commit is contained in:
@@ -2,6 +2,7 @@ package api
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"time"
|
||||
|
||||
"git.dubyatp.xyz/chat-api-server/db"
|
||||
)
|
||||
@@ -39,7 +40,7 @@ func dbGetMessage(id string) (*Message, error) {
|
||||
ID: message["ID"].(string),
|
||||
UserID: int64(message["UserID"].(float64)),
|
||||
Body: message["Body"].(string),
|
||||
Timestamp: int64(message["Timestamp"].(float64)),
|
||||
Timestamp: time.Time(time.Now()),
|
||||
}, nil
|
||||
}
|
||||
}
|
||||
@@ -61,7 +62,7 @@ func dbGetAllMessages() ([]*Message, error) {
|
||||
ID: message["ID"].(string),
|
||||
UserID: int64(message["UserID"].(float64)),
|
||||
Body: message["Body"].(string),
|
||||
Timestamp: int64(message["Timestamp"].(float64)),
|
||||
Timestamp: time.Time(time.Now()),
|
||||
})
|
||||
}
|
||||
if len(result) == 0 {
|
||||
|
Reference in New Issue
Block a user