Add notification doc comments

This commit is contained in:
Max Brunsfeld 2023-10-05 16:43:18 -07:00
parent cf6ce0dbad
commit 50cf25ae97
2 changed files with 21 additions and 5 deletions

View file

@ -42,7 +42,7 @@ impl Database {
let Some(kind) = NotificationKind::from_i32(row.kind) else {
continue;
};
let Some(notification) = Notification::from_fields(
let Some(notification) = Notification::from_parts(
kind,
[
row.entity_id_1.map(|id| id as u64),
@ -54,7 +54,7 @@ impl Database {
};
// Gather the ids of all associated entities.
let (_, associated_entities) = notification.to_fields();
let (_, associated_entities) = notification.to_parts();
for entity in associated_entities {
let Some((id, kind)) = entity else {
break;
@ -124,7 +124,7 @@ impl Database {
notification: Notification,
tx: &DatabaseTransaction,
) -> Result<()> {
let (kind, associated_entities) = notification.to_fields();
let (kind, associated_entities) = notification.to_parts();
notification::ActiveModel {
recipient_id: ActiveValue::Set(recipient_id),
kind: ActiveValue::Set(kind as i32),