aboutsummaryrefslogtreecommitdiffstats
path: root/apps/user_status/src/services/predefinedStatusService.js
blob: b423c6e0cc42c4da86d81c9202424c2c4cb8becd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
/**
 * SPDX-FileCopyrightText: 2020 Nextcloud GmbH and Nextcloud contributors
 * SPDX-License-Identifier: AGPL-3.0-or-later
 */

import HttpClient from '@nextcloud/axios'
import { generateOcsUrl } from '@nextcloud/router'

/**
 * Fetches all predefined statuses from the server
 *
 * @return {Promise<void>}
 */
const fetchAllPredefinedStatuses = async () => {
	const url = generateOcsUrl('apps/user_status/api/v1/predefined_statuses?format=json')
	const response = await HttpClient.get(url)

	return response.data.ocs.data
}

export {
	fetchAllPredefinedStatuses,
}