blob: 56317f7f5e1af2d4e9be518554bda034b27f5e98 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
|
/**
* SPDX-FileCopyrightText: 2022 Nextcloud GmbH and Nextcloud contributors
* SPDX-License-Identifier: AGPL-3.0-or-later
*/
import axios from '@nextcloud/axios'
import { generateOcsUrl } from '@nextcloud/router'
import { emit } from '@nextcloud/event-bus'
export default () => {
return axios.get(generateOcsUrl('core/navigation', 2) + '/apps?format=json')
.then(({ data }) => {
if (data.ocs.meta.statuscode !== 200) {
return
}
emit('nextcloud:app-menu.refresh', { apps: data.ocs.data })
window.dispatchEvent(new Event('resize'))
})
}
|