Add dashboard widget to show the latest notes. Issue #51

p.s: I would like to be able to select a particular tag to show, but
none of the dashboard widgets are configurable.

I hate increasing the app size from 300k to almost 3 mb for something
so simple, but we must adapt to the majority and use vue here.
This commit is contained in:
Matias De lellis
2022-05-25 10:29:20 -03:00
parent e6d52bfa5a
commit b6db15d8d2
14 changed files with 21727 additions and 308 deletions

21
src/NotesService.js Normal file
View File

@@ -0,0 +1,21 @@
import axios from '@nextcloud/axios'
import { generateUrl } from '@nextcloud/router'
import { showError } from '@nextcloud/dialogs'
function url(url) {
url = `apps/quicknotes${url}`
return generateUrl(url)
}
export const getDashboardData = () => {
return axios
.get(url('/notes/dashboard'))
.then(response => {
return response.data
})
.catch(err => {
console.error(err)
showError(t('notes', 'Fetching notes for dashboard has failed.'))
throw err
})
}