Skip to content

Commit

Permalink
Fix isFavorite cloud note bug
Browse files Browse the repository at this point in the history
  • Loading branch information
Ellet committed Dec 28, 2023
1 parent 6c470ea commit 8a58a8a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
4 changes: 4 additions & 0 deletions lib/data/notes/cloud/models/m_cloud_note.dart
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ class CloudNote with _$CloudNote {
static Map<String, Object?> _toFirebaseMapSharedLogic({
required bool isPrivate,
required bool isTrash,
required bool isFavorite,
required String title,
required String text,
}) {
Expand All @@ -94,6 +95,7 @@ class CloudNote with _$CloudNote {
CloudNoteProperties.text: text,
CloudNoteProperties.isPrivate: isPrivate,
CloudNoteProperties.isTrash: isTrash,
CloudNoteProperties.isFavorite: isFavorite,
CloudNoteProperties.updatedAt: FieldValue.serverTimestamp(),
};
}
Expand All @@ -105,6 +107,7 @@ class CloudNote with _$CloudNote {
isPrivate: input.isPrivate,
title: input.title,
text: input.text,
isFavorite: input.isFavorite,
isTrash: false,
);
return {
Expand All @@ -123,6 +126,7 @@ class CloudNote with _$CloudNote {
title: input.title,
text: input.text,
isTrash: input.isTrash,
isFavorite: input.isFavorite,
);
return {
...sharedInputData,
Expand Down
5 changes: 3 additions & 2 deletions lib/data/notes/universal/models/m_note_inputs.dart
Original file line number Diff line number Diff line change
Expand Up @@ -53,15 +53,16 @@ class UpdateNoteInput with _$UpdateNoteInput {
required bool isTrash,
}) = _UpdateNoteInput;

factory UpdateNoteInput.fromCreateInput(CreateNoteInput input) =>
factory UpdateNoteInput.fromCreateInput(CreateNoteInput input,
{required bool isTrash}) =>
UpdateNoteInput(
noteId: input.noteId,
text: input.text,
title: input.title,
isSyncWithCloud: input.isSyncWithCloud,
isPrivate: input.isPrivate,
isFavorite: input.isFavorite,
isTrash: false,
isTrash: isTrash,
userId: input.userId,
);

Expand Down

0 comments on commit 8a58a8a

Please sign in to comment.