Skip to content

Commit

Permalink
[tools] Avoid deprecated API' (mui#155)
Browse files Browse the repository at this point in the history
  • Loading branch information
oliviertassinari authored Apr 23, 2024
1 parent 0b64b74 commit 68ffc38
Show file tree
Hide file tree
Showing 2 changed files with 545 additions and 44 deletions.
20 changes: 17 additions & 3 deletions tools-public/toolpad/resources/queryAbout.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,26 @@ export async function queryAbout() {
// }
// );

const res = await fetch('https://api.hibob.com/v1/people?humanReadable=true', {
const res = await fetch('https://api.hibob.com/v1/people/search', {
method: 'POST',
headers: {
'content-type': 'application/json',
Authorization: `Basic ${btoa(`SERVICE-5772:${process.env.HIBOB_TOKEN_READ_STANDARD}`)}`,
},
method: 'GET',
body: JSON.stringify({
showInactive: false,
humanReadable: 'REPLACE',
fields: [
'root.fullName',
'address.country',
'address.city',
'work.title',
'work.tenureDurationYears',
'about.custom.field_1682954415714',
'about.custom.field_1690557141686',
'about.socialData.twitter',
],
}),
});

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

const countriesRes = await fetch('https://flagcdn.com/en/codes.json', {
method: 'GET',
headers: {
'content-type': 'application/json',
},
method: 'GET',
});

if (countriesRes.status !== 200) {
Expand Down
Loading

0 comments on commit 68ffc38

Please sign in to comment.