fix (backend): make sure to use the exact same time for id and createdAt
This commit is contained in:
parent
def565af9b
commit
db4e0e931b
1 changed files with 4 additions and 3 deletions
|
@ -8,7 +8,7 @@ import {
|
||||||
Followings,
|
Followings,
|
||||||
} from "@/models/index.js";
|
} from "@/models/index.js";
|
||||||
import {
|
import {
|
||||||
genId,
|
genIdAt,
|
||||||
isSilencedServer,
|
isSilencedServer,
|
||||||
sendPushNotification,
|
sendPushNotification,
|
||||||
PushNotificationKind,
|
PushNotificationKind,
|
||||||
|
@ -63,9 +63,10 @@ export async function createNotification(
|
||||||
}
|
}
|
||||||
|
|
||||||
// Create notification
|
// Create notification
|
||||||
|
const createdAt = new Date();
|
||||||
const notification = await Notifications.insert({
|
const notification = await Notifications.insert({
|
||||||
id: genId(),
|
id: genIdAt(createdAt),
|
||||||
createdAt: new Date(),
|
createdAt,
|
||||||
notifieeId: notifieeId,
|
notifieeId: notifieeId,
|
||||||
type: type,
|
type: type,
|
||||||
// 相手がこの通知をミュートしているようなら、既読を予めつけておく
|
// 相手がこの通知をミュートしているようなら、既読を予めつけておく
|
||||||
|
|
Loading…
Reference in a new issue