diff --git a/.eslintrc.cjs b/.eslintrc.cjs index 9a5bdc81e..eb9aa183a 100644 --- a/.eslintrc.cjs +++ b/.eslintrc.cjs @@ -2,6 +2,7 @@ module.exports = { root: true, extends: [ '@nextcloud', + '@nextcloud/eslint-config/typescript', ], rules: { 'jsdoc/require-jsdoc': 'off', diff --git a/src/App.vue b/src/App.vue index 383b2b884..d6837d221 100644 --- a/src/App.vue +++ b/src/App.vue @@ -44,7 +44,7 @@ export default { }, }, watch: { - '$route'(to, from) { + '$route'(to) { this.routing(to) }, }, diff --git a/src/shared/assets/icons/IconTables.vue b/src/shared/assets/icons/IconTables.vue index 71efc1ee2..1c287c6ff 100644 --- a/src/shared/assets/icons/IconTables.vue +++ b/src/shared/assets/icons/IconTables.vue @@ -16,8 +16,10 @@ - diff --git a/src/shared/constants.js b/src/shared/constants.ts similarity index 100% rename from src/shared/constants.js rename to src/shared/constants.ts diff --git a/src/store/api.ts b/src/store/api.ts new file mode 100644 index 000000000..1e07fd257 --- /dev/null +++ b/src/store/api.ts @@ -0,0 +1,29 @@ +/* + * @copyright Copyright (c) 2024 Julius Härtl + * + * @author Julius Härtl + * + * @license GNU AGPL version 3 or any later version + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ + +import axios from '@nextcloud/axios' +import { generateUrl } from '@nextcloud/router' + +import type { getTablesResponse } from '../types/index.ts' + +export const listTables = async (): Promise => { + return axios.get(generateUrl('/apps/tables/table')) +} diff --git a/src/store/store.js b/src/store/store.js index 3303d7ffc..b42a06cb1 100644 --- a/src/store/store.js +++ b/src/store/store.js @@ -6,7 +6,7 @@ import { showError } from '@nextcloud/dialogs' import '@nextcloud/dialogs/style.css' import data from './data.js' import displayError from '../shared/utils/displayError.js' -import { NODE_TYPE_TABLE, NODE_TYPE_VIEW } from '../shared/constants.js' +import { NODE_TYPE_TABLE, NODE_TYPE_VIEW } from '../shared/constants.ts' Vue.use(Vuex)