Skip to content

Commit

Permalink
chore: Dependencies updated (#127)
Browse files Browse the repository at this point in the history
Depences updated to latest
  • Loading branch information
yp969803 authored Dec 17, 2023
2 parents 30f1c6c + c63076b commit cbc958e
Show file tree
Hide file tree
Showing 16 changed files with 13,189 additions and 17,850 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
.env.development.local
.env.test.local
.env.production.local
.env

npm-debug.log*
yarn-debug.log*
Expand Down
29,618 changes: 11,794 additions & 17,824 deletions package-lock.json

Large diffs are not rendered by default.

47 changes: 25 additions & 22 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,20 @@
"version": "0.1.0",
"private": true,
"dependencies": {
"@reduxjs/toolkit": "^1.9.2",
"@testing-library/jest-dom": "^5.16.5",
"@testing-library/react": "^13.4.0",
"@testing-library/user-event": "^13.5.0",
"eslint-config-prettier": "^8.6.0",
"@reduxjs/toolkit": "^1.9.6",
"@testing-library/jest-dom": "^6.1.3",
"@testing-library/react": "^14.0.0",
"@testing-library/user-event": "^14.5.1",
"axios": "^1.6.2",
"eslint-config-prettier": "^9.0.0",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-redux": "^8.0.5",
"react-router-dom": "^6.8.0",
"react-redux": "^8.1.3",
"react-router-dom": "^6.16.0",
"react-scripts": "^5.0.1",
"react-simply-carousel": "^8.5.5",
"web-vitals": "^3.1.1"
"react-simply-carousel": "^9.0.4",
"redux-thunk": "^3.1.0",
"web-vitals": "^3.5.0"
},
"scripts": {
"start": "react-scripts start",
Expand Down Expand Up @@ -50,19 +52,20 @@
]
},
"devDependencies": {
"@types/jest": "^29.4.0",
"@types/node": "^18.11.19",
"@types/react": "^18.0.27",
"@types/react-dom": "^18.0.10",
"@typescript-eslint/eslint-plugin": "^5.51.0",
"@typescript-eslint/parser": "^5.51.0",
"eslint": "^8.33.0",
"eslint-plugin-prettier": "^4.2.1",
"eslint-plugin-react": "^7.32.2",
"@types/jest": "^29.5.5",
"@types/node": "^20.8.0",
"@types/react": "^18.2.24",
"@types/react-dom": "^18.2.8",
"@typescript-eslint/eslint-plugin": "^6.7.3",
"@typescript-eslint/parser": "^6.7.3",
"dotenv": "^16.3.1",
"eslint": "^8.50.0",
"eslint-plugin-prettier": "^5.0.0",
"eslint-plugin-react": "^7.33.2",
"eslint-plugin-react-hooks": "^4.6.0",
"husky": "^8.0.0",
"prettier": "^2.8.4",
"sass": "^1.58.0",
"typescript": "^4.9.5"
"husky": "^8.0.3",
"prettier": "^3.0.3",
"sass": "^1.68.0",
"typescript": "^5.2.2"
}
}
2 changes: 1 addition & 1 deletion public/index.html
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" />
Expand Down
43 changes: 43 additions & 0 deletions src/app/api/file.ts
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;
};
19 changes: 19 additions & 0 deletions src/app/api/login.ts
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;
};
207 changes: 207 additions & 0 deletions src/app/api/organization.ts
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;
};
Loading

0 comments on commit cbc958e

Please sign in to comment.