2020-06-02 06:48:37 -04:00
|
|
|
/**
|
|
|
|
|
* @copyright Copyright (c) 2020 Georg Ehrke
|
|
|
|
|
*
|
|
|
|
|
* @author Georg Ehrke <oc.list@georgehrke.com>
|
|
|
|
|
*
|
2022-01-11 11:18:11 -05:00
|
|
|
* @license AGPL-3.0-or-later
|
2020-06-02 06:48:37 -04:00
|
|
|
*
|
|
|
|
|
* 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 <http://www.gnu.org/licenses/>.
|
|
|
|
|
*
|
|
|
|
|
*/
|
2021-03-31 06:15:40 -04:00
|
|
|
|
2020-06-02 06:48:37 -04:00
|
|
|
import HttpClient from '@nextcloud/axios'
|
|
|
|
|
import { generateOcsUrl } from '@nextcloud/router'
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Fetches all predefined statuses from the server
|
|
|
|
|
*
|
2021-12-02 12:32:57 -05:00
|
|
|
* @return {Promise<void>}
|
2020-06-02 06:48:37 -04:00
|
|
|
*/
|
2021-12-02 12:32:57 -05:00
|
|
|
const fetchAllPredefinedStatuses = async () => {
|
2021-07-15 08:46:14 -04:00
|
|
|
const url = generateOcsUrl('apps/user_status/api/v1/predefined_statuses?format=json')
|
2020-06-02 06:48:37 -04:00
|
|
|
const response = await HttpClient.get(url)
|
|
|
|
|
|
|
|
|
|
return response.data.ocs.data
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export {
|
|
|
|
|
fetchAllPredefinedStatuses,
|
|
|
|
|
}
|