Skip to content
This repository has been archived by the owner on Mar 7, 2023. It is now read-only.

Commit

Permalink
fix(api): update visitor_id field name in req.headers to visitorid
Browse files Browse the repository at this point in the history
  • Loading branch information
rhahao authored Sep 30, 2022
1 parent c293452 commit a5dad3d
Show file tree
Hide file tree
Showing 20 changed files with 35 additions and 35 deletions.
2 changes: 1 addition & 1 deletion src/components/administration/VipFindUser.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ const VipFindUser = ({ setMember }) => {
method: 'GET',
headers: {
'Content-Type': 'application/json',
visitor_id: visitorID,
visitorid: visitorID,
email: userEmail,
},
}
Expand Down
2 changes: 1 addition & 1 deletion src/components/administration/VipUser.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ const VipUser = ({ member, setMembers }) => {
method: 'DELETE',
headers: {
'Content-Type': 'application/json',
visitor_id: visitorID,
visitorid: visitorID,
email: userEmail,
},
}
Expand Down
2 changes: 1 addition & 1 deletion src/components/administration/VipUsers.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ const VipUsers = () => {
method: 'GET',
headers: {
'Content-Type': 'application/json',
visitor_id: visitorID,
visitorid: visitorID,
email: userEmail,
},
}
Expand Down
2 changes: 1 addition & 1 deletion src/components/root/UserAutoLogin.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ const UserAutoLogin = () => {
method: 'GET',
headers: {
'Content-Type': 'application/json',
visitor_id: visitorID,
visitorid: visitorID,
email: userEmail,
},
});
Expand Down
2 changes: 1 addition & 1 deletion src/components/root/UserSignOut.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ const UserSignOut = () => {
method: 'GET',
headers: {
'Content-Type': 'application/json',
visitor_id: visitorID,
visitorid: visitorID,
email: userEmail,
},
});
Expand Down
2 changes: 1 addition & 1 deletion src/components/schedule/SchedulePublish.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ const SchedulePublish = () => {
method: 'POST',
headers: {
'Content-Type': 'application/json',
visitor_id: visitorID,
visitorid: visitorID,
email: userEmail,
},
body: JSON.stringify({ cong_schedule, cong_sourceMaterial }),
Expand Down
4 changes: 2 additions & 2 deletions src/components/settings/BackupDbDialog.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ const BackupDbDialog = () => {
method: 'GET',
headers: {
'Content-Type': 'application/json',
visitor_id: visitorID,
visitorid: visitorID,
email: userEmail,
},
}
Expand Down Expand Up @@ -134,7 +134,7 @@ const BackupDbDialog = () => {
method: 'POST',
headers: {
'Content-Type': 'application/json',
visitor_id: visitorID,
visitorid: visitorID,
email: userEmail,
},
body: JSON.stringify(reqPayload),
Expand Down
4 changes: 2 additions & 2 deletions src/components/settings/RestoreDbDialog.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ const RestoreDbDialog = () => {
method: 'GET',
headers: {
'Content-Type': 'application/json',
visitor_id: visitorID,
visitorid: visitorID,
email: userEmail,
},
}
Expand Down Expand Up @@ -123,7 +123,7 @@ const RestoreDbDialog = () => {
method: 'GET',
headers: {
'Content-Type': 'application/json',
visitor_id: visitorID,
visitorid: visitorID,
email: userEmail,
},
}
Expand Down
2 changes: 1 addition & 1 deletion src/components/settings/User2FA.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ const User2FA = () => {
method: 'GET',
headers: {
'Content-Type': 'application/json',
visitor_id: visitorID,
visitorid: visitorID,
email: userEmail,
},
});
Expand Down
2 changes: 1 addition & 1 deletion src/components/settings/UserChangePassword.js
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ const UserChangePassword = () => {
method: 'PATCH',
headers: {
'Content-Type': 'application/json',
visitor_id: visitorID,
visitorid: visitorID,
email: userEmail,
},
body: JSON.stringify({ password: newPassword }),
Expand Down
2 changes: 1 addition & 1 deletion src/components/settings/UserFullname.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ const UserFullname = () => {
method: 'PATCH',
headers: {
'Content-Type': 'application/json',
visitor_id: visitorID,
visitorid: visitorID,
email: userEmail,
},
body: JSON.stringify({ fullname: tmpUsername }),
Expand Down
6 changes: 3 additions & 3 deletions src/components/settings/UserSessionItem.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,10 @@ const UserSessionItem = ({ session, setSessions }) => {
method: 'DELETE',
headers: {
'Content-Type': 'application/json',
visitor_id: visitorID,
visitorid: visitorID,
email: userEmail,
},
body: JSON.stringify({ session: session.visitor_id }),
body: JSON.stringify({ session: session.visitorid }),
});

const data = await res.json();
Expand Down Expand Up @@ -102,7 +102,7 @@ const UserSessionItem = ({ session, setSessions }) => {
<Typography sx={{ fontSize: '14px' }}>
{t('settings.lastSeen', { last_seen: lastSeen })}
</Typography>
{visitorID === session.visitor_id && (
{visitorID === session.visitorid && (
<Chip
label={t('settings.currentSession')}
sx={{
Expand Down
4 changes: 2 additions & 2 deletions src/components/settings/UserSessions.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ const UserSessions = () => {
method: 'GET',
headers: {
'Content-Type': 'application/json',
visitor_id: visitorID,
visitorid: visitorID,
email: userEmail,
},
});
Expand Down Expand Up @@ -100,7 +100,7 @@ const UserSessions = () => {
{sessions.length > 0 &&
sessions.map((session) => (
<UserSessionItem
key={session.visitor_id}
key={session.visitorid}
session={session}
setSessions={(value) => setSessions(value)}
/>
Expand Down
2 changes: 1 addition & 1 deletion src/components/startup/CongregationSignUp.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ const CongregationSignUp = () => {
method: 'PUT',
headers: {
'Content-Type': 'application/json',
visitor_id: visitorID,
visitorid: visitorID,
email: userEmail,
},
body: JSON.stringify(reqPayload),
Expand Down
2 changes: 1 addition & 1 deletion src/components/startup/EmailNotVerified.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ const EmailNotVerified = () => {
method: 'GET',
headers: {
'Content-Type': 'application/json',
visitor_id: visitorID,
visitorid: visitorID,
email: userEmail,
},
})
Expand Down
2 changes: 1 addition & 1 deletion src/components/startup/UserMfaSetup.js
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ const UserMfaSetup = () => {
method: 'POST',
headers: {
'Content-Type': 'application/json',
visitor_id: visitorID,
visitorid: visitorID,
email: userEmail,
},
body: JSON.stringify(reqPayload),
Expand Down
2 changes: 1 addition & 1 deletion src/components/startup/UserMfaVerify.js
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ const UserMfaVerify = () => {
method: 'POST',
headers: {
'Content-Type': 'application/json',
visitor_id: visitorID,
visitorid: visitorID,
email: userEmail,
},
body: JSON.stringify(reqPayload),
Expand Down
2 changes: 1 addition & 1 deletion src/components/startup/UserSignIn.js
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ const UserSignIn = () => {
const reqPayload = {
email: userTmpEmail,
password: userTmpPwd,
visitor_id: visitorID,
visitorid: visitorID,
};

if (apiHost !== '') {
Expand Down
20 changes: 10 additions & 10 deletions src/components/students/StudentPocket.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ const StudentPocket = ({ id, name }) => {
method: 'GET',
headers: {
'Content-Type': 'application/json',
visitor_id: visitorID,
visitorid: visitorID,
email: userEmail,
},
}
Expand Down Expand Up @@ -103,7 +103,7 @@ const StudentPocket = ({ id, name }) => {
method: 'PATCH',
headers: {
'Content-Type': 'application/json',
visitor_id: visitorID,
visitorid: visitorID,
email: userEmail,
},
body: JSON.stringify({ username: name }),
Expand Down Expand Up @@ -152,7 +152,7 @@ const StudentPocket = ({ id, name }) => {
method: 'PATCH',
headers: {
'Content-Type': 'application/json',
visitor_id: visitorID,
visitorid: visitorID,
email: userEmail,
},
body: JSON.stringify({ members }),
Expand Down Expand Up @@ -194,7 +194,7 @@ const StudentPocket = ({ id, name }) => {
method: 'PUT',
headers: {
'Content-Type': 'application/json',
visitor_id: visitorID,
visitorid: visitorID,
email: userEmail,
},
body: JSON.stringify({ username: name }),
Expand Down Expand Up @@ -225,7 +225,7 @@ const StudentPocket = ({ id, name }) => {
}
};

const handleDeleteDevice = async (pocket_visitor_id) => {
const handleDeleteDevice = async (pocket_visitorid) => {
try {
if (apiHost !== '') {
setIsGenerating(true);
Expand All @@ -236,10 +236,10 @@ const StudentPocket = ({ id, name }) => {
method: 'DELETE',
headers: {
'Content-Type': 'application/json',
visitor_id: visitorID,
visitorid: visitorID,
email: userEmail,
},
body: JSON.stringify({ pocket_visitor_id }),
body: JSON.stringify({ pocket_visitorid }),
}
);

Expand Down Expand Up @@ -291,7 +291,7 @@ const StudentPocket = ({ id, name }) => {
method: 'GET',
headers: {
'Content-Type': 'application/json',
visitor_id: visitorID,
visitorid: visitorID,
email: userEmail,
},
}
Expand Down Expand Up @@ -453,7 +453,7 @@ const StudentPocket = ({ id, name }) => {
<Divider />
{devices.map((device) => (
<Box
key={device.visitor_id}
key={device.visitorid}
sx={{
display: 'flex',
alignItems: 'center',
Expand Down Expand Up @@ -507,7 +507,7 @@ const StudentPocket = ({ id, name }) => {
variant='outlined'
color='error'
sx={{ marginBottom: '10px' }}
onClick={() => handleDeleteDevice(device.visitor_id)}
onClick={() => handleDeleteDevice(device.visitorid)}
disabled={isGenerating}
>
{t('settings.sessionRevoke')}
Expand Down
4 changes: 2 additions & 2 deletions src/pages/VipUserDetail.js
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ const VipUserDetail = () => {
method: 'GET',
headers: {
'Content-Type': 'application/json',
visitor_id: visitorID,
visitorid: visitorID,
email: userEmail,
},
}
Expand Down Expand Up @@ -151,7 +151,7 @@ const VipUserDetail = () => {
method: `${id ? 'PATCH' : 'PUT'}`,
headers: {
'Content-Type': 'application/json',
visitor_id: visitorID,
visitorid: visitorID,
email: userEmail,
},
body: JSON.stringify({ user_role: member.cong_role }),
Expand Down

0 comments on commit a5dad3d

Please sign in to comment.