This repository has been archived on 2026-06-02. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
FabledApp/lib/data/repositories/notes_repository.dart
T

38 lines
901 B
Dart

import '../api/notes_api.dart';
import '../models/note.dart';
class NotesRepository {
final NotesApi _api;
const NotesRepository(this._api);
Future<List<Note>> getAll() => _api.getAll();
Future<Note> getOne(int id) => _api.getOne(id);
Future<Note> create(
String title,
String body, {
List<String> tags = const [],
int? projectId,
String noteType = 'note',
}) =>
_api.create(title, body,
tags: tags, projectId: projectId, noteType: noteType);
Future<Note> update(
int id,
String title,
String body, {
List<String> tags = const [],
int? projectId,
bool clearProject = false,
String noteType = 'note',
}) =>
_api.update(id, title, body,
tags: tags,
projectId: projectId,
clearProject: clearProject,
noteType: noteType);
Future<void> delete(int id) => _api.delete(id);
}