linguabot commited on
Commit
305f30b
·
verified ·
1 Parent(s): 45ed7cb

Upload folder using huggingface_hub

Browse files
Files changed (1) hide show
  1. client/src/components/Refinity.tsx +22 -2
client/src/components/Refinity.tsx CHANGED
@@ -1634,7 +1634,17 @@ const Refinity: React.FC = () => {
1634
  };
1635
  let resp = await fetch(getApiBase('/compare-comments-with-corrections'), {
1636
  method: 'POST',
1637
- headers: { 'Content-Type': 'application/json' },
 
 
 
 
 
 
 
 
 
 
1638
  body: JSON.stringify(body),
1639
  });
1640
  if (!resp.ok) {
@@ -2762,7 +2772,17 @@ const EditorPane: React.FC<{ source: string; initialTranslation: string; onBack:
2762
  };
2763
  let resp = await fetch(getApiBase('/compare-comments-with-corrections'), {
2764
  method: 'POST',
2765
- headers: { 'Content-Type': 'application/json' },
 
 
 
 
 
 
 
 
 
 
2766
  body: JSON.stringify(body),
2767
  });
2768
  if (!resp.ok) {
 
1634
  };
1635
  let resp = await fetch(getApiBase('/compare-comments-with-corrections'), {
1636
  method: 'POST',
1637
+ headers: (() => {
1638
+ const user = JSON.parse(localStorage.getItem('user') || '{}');
1639
+ const headers: any = { 'Content-Type': 'application/json' };
1640
+ if (user.name) headers['x-user-name'] = user.name;
1641
+ if (user.email) headers['x-user-email'] = user.email;
1642
+ if (user.role) {
1643
+ headers['x-user-role'] = user.role;
1644
+ headers['user-role'] = user.role;
1645
+ }
1646
+ return headers;
1647
+ })(),
1648
  body: JSON.stringify(body),
1649
  });
1650
  if (!resp.ok) {
 
2772
  };
2773
  let resp = await fetch(getApiBase('/compare-comments-with-corrections'), {
2774
  method: 'POST',
2775
+ headers: (() => {
2776
+ const user = JSON.parse(localStorage.getItem('user') || '{}');
2777
+ const headers: any = { 'Content-Type': 'application/json' };
2778
+ if (user.name) headers['x-user-name'] = user.name;
2779
+ if (user.email) headers['x-user-email'] = user.email;
2780
+ if (user.role) {
2781
+ headers['x-user-role'] = user.role;
2782
+ headers['user-role'] = user.role;
2783
+ }
2784
+ return headers;
2785
+ })(),
2786
  body: JSON.stringify(body),
2787
  });
2788
  if (!resp.ok) {