From: Adam Dullage Date: Thu, 2 May 2024 12:19:27 +0000 (+0100) Subject: Update API getNotes function to return a SearchResult X-Git-Url: http://git.99rst.org/?a=commitdiff_plain;h=409cefe6d6738c2b1a09fed513f7d92bf9285793;p=flatnotes.git Update API getNotes function to return a SearchResult --- diff --git a/client/api.js b/client/api.js index f882f24..196d4c4 100644 --- a/client/api.js +++ b/client/api.js @@ -1,6 +1,7 @@ import * as constants from "./constants.js"; -import { Note } from "./classes.js"; +import { Note, SearchResult } from "./classes.js"; + import axios from "axios"; import { getStoredToken } from "./tokenStorage.js"; import router from "./router.js"; @@ -73,7 +74,7 @@ export async function getNotes(term, sort, order, limit) { }, }); return response.data.map( - (note) => new Note(note.title, note.lastModified, note.content), + (note) => new SearchResult(note), ); } catch (response) { return Promise.reject(response);