blob: 2181ea7d3aeaf582e198a03337bcbb054ca0acfe (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
|
import {ALL_USERS_ENDPOINT} from '../constants';
export const getAllTaggUsers = async (token: string) => {
try {
const response = await fetch(ALL_USERS_ENDPOINT, {
method: 'GET',
headers: {
Authorization: 'Token ' + token,
},
});
const status = response.status;
if (status === 200) {
const response_data = await response.json();
return response_data;
} else {
console.log(
'Something went wrong! 😭',
'Not able to retrieve tagg users list',
);
}
} catch (error) {
console.log(
'Something went wrong! 😭',
'Not able to retrieve tagg users list',
error,
);
}
};
|