-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Depences updated to latest
- Loading branch information
Showing
16 changed files
with
13,189 additions
and
17,850 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,6 +17,7 @@ | |
.env.development.local | ||
.env.test.local | ||
.env.production.local | ||
.env | ||
|
||
npm-debug.log* | ||
yarn-debug.log* | ||
|
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
<!DOCTYPE html> | ||
<!doctype html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="utf-8" /> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
import axios from 'axios'; | ||
import { BACKEND_URL } from 'envConstants'; | ||
|
||
export const uploadIcon = async ( | ||
authorizationToken: string, | ||
orgName: string, | ||
file: File | ||
) => { | ||
const url = BACKEND_URL + '/api/protected/file/upload/' + orgName; | ||
const formData = new FormData(); | ||
formData.append('file', file); | ||
const respnse = await axios.post(url, formData, { | ||
headers: { | ||
Accept: 'application/json', | ||
Authorization: `Bearer ${authorizationToken}`, | ||
}, | ||
}); | ||
return respnse; | ||
}; | ||
|
||
export const getIcon = async (authorizationToken: string, orgName: string) => { | ||
const url = BACKEND_URL + '/api/protected/file/getIcon/' + orgName; | ||
const response = await axios.get(url, { | ||
headers: { | ||
Authorization: `Bearer ${authorizationToken}`, | ||
}, | ||
}); | ||
return response; | ||
}; | ||
|
||
export const deleteFile = async ( | ||
authorizationToken: string, | ||
fileName: string | ||
) => { | ||
const url = BACKEND_URL + '/api/protected/file/delete?fileName=' + fileName; | ||
const respnse = await axios.delete(url, { | ||
headers: { | ||
Accept: 'application/json', | ||
Authorization: `Bearer ${authorizationToken}`, | ||
}, | ||
}); | ||
return respnse; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import axios from 'axios'; | ||
import { BACKEND_URL } from 'envConstants'; | ||
|
||
export const login = async (code: string) => { | ||
const url = BACKEND_URL + '/api/auth/login'; | ||
const respnse = await axios.post( | ||
url, | ||
{ | ||
code: code, | ||
}, | ||
{ | ||
headers: { | ||
Accept: 'application/json', | ||
}, | ||
} | ||
); | ||
|
||
return respnse; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,207 @@ | ||
import axios from 'axios'; | ||
import { BACKEND_URL } from 'envConstants'; | ||
|
||
export interface organizationBody { | ||
name: string; | ||
description: string; | ||
} | ||
|
||
export const deleteOrg = async ( | ||
authorizationToken: string, | ||
orgName: string | ||
) => { | ||
const url = BACKEND_URL + '/api/protected/org/delete/' + orgName; | ||
const respnse = await axios.delete(url, { | ||
headers: { | ||
Accept: 'application/json', | ||
Authorization: `Bearer ${authorizationToken}`, | ||
}, | ||
}); | ||
return respnse; | ||
}; | ||
|
||
export const addOrg = async ( | ||
authorizationToken: string, | ||
org: organizationBody | ||
) => { | ||
const url = BACKEND_URL + '/api/protected/org/add'; | ||
const respnse = await axios.post(url, org, { | ||
headers: { | ||
Accept: 'application/json', | ||
Authorization: `Bearer ${authorizationToken}`, | ||
}, | ||
}); | ||
return respnse; | ||
}; | ||
|
||
export const updateOrg = async ( | ||
authorizationToken: string, | ||
orgName: string, | ||
org: organizationBody | ||
) => { | ||
const url = BACKEND_URL + '/api/protected/org/update/' + orgName; | ||
const response = await axios.put(url, org, { | ||
headers: { | ||
Accept: 'application/json', | ||
Authorization: `Bearer ${authorizationToken}`, | ||
}, | ||
}); | ||
|
||
return response; | ||
}; | ||
|
||
export const addOrgMembers = async ( | ||
authorizationToken: string, | ||
orgName: string, | ||
members: string[] | ||
) => { | ||
const url = BACKEND_URL + '/api/protected/org/addMembers/' + orgName; | ||
const respnse = await axios.post( | ||
url, | ||
{ | ||
members: members, | ||
}, | ||
{ | ||
headers: { | ||
Accept: 'application/json', | ||
Authorization: `Bearer ${authorizationToken}`, | ||
}, | ||
} | ||
); | ||
|
||
return respnse; | ||
}; | ||
|
||
export const removeOrgMembers = async ( | ||
authorizationToken: string, | ||
orgName: string, | ||
members: string[] | ||
) => { | ||
const url = BACKEND_URL + '/api/protected/org/removeMembers/' + orgName; | ||
const response = axios.delete(url, { | ||
headers: { | ||
Accept: 'application/json', | ||
Authorization: `Bearer ${authorizationToken}`, | ||
}, | ||
data: { | ||
members: members, | ||
}, | ||
}); | ||
return response; | ||
}; | ||
|
||
export const changeOrgMembersStatus = async ( | ||
authorizationToken: string, | ||
orgName: string, | ||
orgMemberStatus: { [key: string]: string } | ||
) => { | ||
const url = BACKEND_URL + '/api/protected/org/removeMembers/'; | ||
const respnse = await axios.put( | ||
url, | ||
{ | ||
orgMemberStatus: orgMemberStatus, | ||
}, | ||
{ | ||
headers: { | ||
Accept: 'application/json', | ||
Authorization: `Bearer ${authorizationToken}`, | ||
}, | ||
} | ||
); | ||
|
||
return respnse; | ||
}; | ||
|
||
export const setArcheiveStatus = async ( | ||
authorizationToken: string, | ||
orgName: string, | ||
archeiveStatus: { [key: string]: boolean } | ||
) => { | ||
const url = BACKEND_URL + '/api/protected/org/setArcheiveStatus/' + orgName; | ||
const respnse = await axios.put( | ||
url, | ||
{ | ||
archeiveStatus: archeiveStatus, | ||
}, | ||
{ | ||
headers: { | ||
Accept: 'application/json', | ||
Authorization: `Bearer ${authorizationToken}`, | ||
}, | ||
} | ||
); | ||
return respnse; | ||
}; | ||
|
||
export const setBookmarkStatus = async ( | ||
authorizationToken: string, | ||
orgName: string, | ||
bookmarkStatus: { [key: string]: boolean } | ||
) => { | ||
const url = BACKEND_URL + '/api/protected/org/setBookmarkStatus/' + orgName; | ||
const respnse = await axios.put( | ||
url, | ||
{ | ||
bookmarkStatus: bookmarkStatus, | ||
}, | ||
{ | ||
headers: { | ||
Accept: 'application/json', | ||
Authorization: `Bearer ${authorizationToken}`, | ||
}, | ||
} | ||
); | ||
|
||
return respnse; | ||
}; | ||
|
||
export const getOrgMembers = async ( | ||
authorizationToken: string, | ||
orgName: string | ||
) => { | ||
const url = BACKEND_URL + '/api/protected/org/getMembers/' + orgName; | ||
|
||
const respnse = await axios.get(url, { | ||
headers: { | ||
Accept: 'application/json', | ||
Authorization: `Bearer ${authorizationToken}`, | ||
}, | ||
}); | ||
return respnse; | ||
}; | ||
|
||
export const getOrgProjects = async ( | ||
authorizationToken: string, | ||
orgName: string | ||
) => { | ||
const url = BACKEND_URL + '/api/protected/org/getProjects/' + orgName; | ||
const respnse = await axios.get(url, { | ||
headers: { | ||
Accept: 'application/json', | ||
Authorization: `Bearer ${authorizationToken}`, | ||
}, | ||
}); | ||
return respnse; | ||
}; | ||
|
||
export const getOrg = async (authorizationToken: string, orgName: string) => { | ||
const url = BACKEND_URL + '/api/protected/org/getProjects/' + orgName; | ||
const respnse = await axios.get(url, { | ||
headers: { | ||
Accept: 'application/json', | ||
Authorization: `Bearer ${authorizationToken}`, | ||
}, | ||
}); | ||
return respnse; | ||
}; | ||
|
||
export const getAllOrgs = async (authorizationToken: string) => { | ||
const url = BACKEND_URL + '/api/protected/org/getAllOrg'; | ||
const respnse = await axios.get(url, { | ||
headers: { | ||
Accept: 'application/json', | ||
Authorization: `Bearer ${authorizationToken}`, | ||
}, | ||
}); | ||
return respnse; | ||
}; |
Oops, something went wrong.