Fix various bugs and shit
This commit is contained in:
@@ -171,7 +171,7 @@ Future<void> setSetting(String key, String value) async {
|
||||
headers: header,
|
||||
body: jsonEncode(document),
|
||||
);
|
||||
if (response.statusCode != 200) {
|
||||
if (response.statusCode != 202) {
|
||||
throw Exception('Failed to set settings');
|
||||
}
|
||||
}
|
||||
@@ -181,7 +181,7 @@ Future<void> setSetting(String key, String value) async {
|
||||
Future<List<Note>> searchNotes(String query) async {
|
||||
final searchCondition = MeilisearchQuery(
|
||||
q: query,
|
||||
limit: 1000,
|
||||
limit: 10,
|
||||
attributesToHighlight: ['content'],
|
||||
showRankingScore: true,
|
||||
highlightPreTag: '<b>',
|
||||
@@ -201,7 +201,7 @@ Future<List<Note>> searchNotes(String query) async {
|
||||
(hit) => Note(
|
||||
id: hit['id'] as String,
|
||||
epochTime: hit['date'] as int,
|
||||
content: hit['content'] as String,
|
||||
content: hit['_formatted']['content'] as String,
|
||||
),
|
||||
)
|
||||
.toList();
|
||||
@@ -336,7 +336,7 @@ Future<Note> createNote(String content) async {
|
||||
headers: header,
|
||||
body: jsonEncode(document),
|
||||
);
|
||||
if (response.statusCode != 200) {
|
||||
if (response.statusCode != 202) {
|
||||
throw Exception('Failed to create note');
|
||||
}
|
||||
return Note(
|
||||
|
Reference in New Issue
Block a user