Skip to content

Commit 68ffc38

Browse files
[tools] Avoid deprecated API' (#155)
1 parent 0b64b74 commit 68ffc38

File tree

2 files changed

+545
-44
lines changed

2 files changed

+545
-44
lines changed

tools-public/toolpad/resources/queryAbout.ts

+17-3
Original file line numberDiff line numberDiff line change
@@ -40,12 +40,26 @@ export async function queryAbout() {
4040
// }
4141
// );
4242

43-
const res = await fetch('https://api.hibob.com/v1/people?humanReadable=true', {
43+
const res = await fetch('https://api.hibob.com/v1/people/search', {
44+
method: 'POST',
4445
headers: {
4546
'content-type': 'application/json',
4647
Authorization: `Basic ${btoa(`SERVICE-5772:${process.env.HIBOB_TOKEN_READ_STANDARD}`)}`,
4748
},
48-
method: 'GET',
49+
body: JSON.stringify({
50+
showInactive: false,
51+
humanReadable: 'REPLACE',
52+
fields: [
53+
'root.fullName',
54+
'address.country',
55+
'address.city',
56+
'work.title',
57+
'work.tenureDurationYears',
58+
'about.custom.field_1682954415714',
59+
'about.custom.field_1690557141686',
60+
'about.socialData.twitter',
61+
],
62+
}),
4963
});
5064

5165
if (res.status !== 200) {
@@ -54,10 +68,10 @@ export async function queryAbout() {
5468
const data = await res.json();
5569

5670
const countriesRes = await fetch('https://flagcdn.com/en/codes.json', {
71+
method: 'GET',
5772
headers: {
5873
'content-type': 'application/json',
5974
},
60-
method: 'GET',
6175
});
6276

6377
if (countriesRes.status !== 200) {

0 commit comments

Comments
 (0)