feat(knowledge): add noteType field to Note model, api, repository, provider

This commit is contained in:
2026-04-04 23:37:53 -04:00
parent e89626a782
commit c8cdcbf230
5 changed files with 55 additions and 8 deletions
+9 -3
View File
@@ -17,10 +17,14 @@ class NotesNotifier extends AsyncNotifier<List<Note>> {
String body, {
List<String> tags = const [],
int? projectId,
String noteType = 'note',
}) async {
final note = await ref
.read(notesRepositoryProvider)
.create(title, body, tags: tags, projectId: projectId);
final note = await ref.read(notesRepositoryProvider).create(
title, body,
tags: tags,
projectId: projectId,
noteType: noteType,
);
state = AsyncData([...state.value ?? [], note]);
return note;
}
@@ -32,6 +36,7 @@ class NotesNotifier extends AsyncNotifier<List<Note>> {
List<String> tags = const [],
int? projectId,
bool clearProject = false,
String noteType = 'note',
}) async {
final updated = await ref.read(notesRepositoryProvider).update(
id,
@@ -40,6 +45,7 @@ class NotesNotifier extends AsyncNotifier<List<Note>> {
tags: tags,
projectId: projectId,
clearProject: clearProject,
noteType: noteType,
);
state = AsyncData([
for (final n in state.value ?? [])