diff options
author | skjnldsv <skjnldsv@protonmail.com> | 2024-02-22 10:20:21 +0100 |
---|---|---|
committer | skjnldsv <skjnldsv@protonmail.com> | 2024-02-23 14:12:14 +0100 |
commit | 7b9581129014f0c430272b8288ed9e45c0362499 (patch) | |
tree | c2ca8e55a17159d23ab5f3b8243c1a43997972d0 /apps/files_sharing | |
parent | f1c79cd264ebadd0c191bd29abb9280c49aec3da (diff) | |
download | nextcloud-server-7b9581129014f0c430272b8288ed9e45c0362499.tar.gz nextcloud-server-7b9581129014f0c430272b8288ed9e45c0362499.zip |
chore(files_sharing): use `OCSResponse` from `@nextcloud/typings`
Signed-off-by: skjnldsv <skjnldsv@protonmail.com>
Diffstat (limited to 'apps/files_sharing')
-rw-r--r-- | apps/files_sharing/src/services/SharingService.spec.ts | 5 | ||||
-rw-r--r-- | apps/files_sharing/src/services/SharingService.ts | 12 | ||||
-rw-r--r-- | apps/files_sharing/src/views/shares.spec.ts | 2 |
3 files changed, 5 insertions, 14 deletions
diff --git a/apps/files_sharing/src/services/SharingService.spec.ts b/apps/files_sharing/src/services/SharingService.spec.ts index 54e2355b082..db9cb81e348 100644 --- a/apps/files_sharing/src/services/SharingService.spec.ts +++ b/apps/files_sharing/src/services/SharingService.spec.ts @@ -19,12 +19,13 @@ * along with this program. If not, see <http://www.gnu.org/licenses/>. * */ +import type { OCSResponse } from '@nextcloud/typings/ocs' import { expect } from '@jest/globals' -import axios from '@nextcloud/axios' import { Type } from '@nextcloud/sharing' import * as auth from '@nextcloud/auth' +import axios from '@nextcloud/axios' -import { getContents, type OCSResponse } from './SharingService' +import { getContents } from './SharingService' import { File, Folder } from '@nextcloud/files' import logger from './logger' diff --git a/apps/files_sharing/src/services/SharingService.ts b/apps/files_sharing/src/services/SharingService.ts index 2f167dab535..41861c5d3ea 100644 --- a/apps/files_sharing/src/services/SharingService.ts +++ b/apps/files_sharing/src/services/SharingService.ts @@ -21,6 +21,7 @@ */ /* eslint-disable camelcase, n/no-extraneous-import */ import type { AxiosPromise } from 'axios' +import type { OCSResponse } from '@nextcloud/typings/ocs' import { Folder, File, type ContentsWithRoot } from '@nextcloud/files' import { generateOcsUrl, generateRemoteUrl } from '@nextcloud/router' @@ -31,17 +32,6 @@ import logger from './logger' export const rootPath = `/files/${getCurrentUser()?.uid}` -export type OCSResponse<T> = { - ocs: { - meta: { - status: string - statuscode: number - message: string - }, - data: T[] - } -} - const headers = { 'Content-Type': 'application/json', } diff --git a/apps/files_sharing/src/views/shares.spec.ts b/apps/files_sharing/src/views/shares.spec.ts index 346af165f47..73a55434343 100644 --- a/apps/files_sharing/src/views/shares.spec.ts +++ b/apps/files_sharing/src/views/shares.spec.ts @@ -20,12 +20,12 @@ * */ /* eslint-disable n/no-extraneous-import */ +import type { OCSResponse } from '@nextcloud/typings/ocs' import { expect } from '@jest/globals' import { Folder, Navigation, View, getNavigation } from '@nextcloud/files' import axios from '@nextcloud/axios' import '../main' -import { type OCSResponse } from '../services/SharingService' import registerSharingViews from './shares' declare global { |