Skip to content
Merged

Sudo #128

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@
"jest": true
},
"extends": [
"eslint:recommended",
"plugin:react/recommended",
"plugin:@typescript-eslint/recommended",
"plugin:@typescript-eslint/recommended-requiring-type-checking",
// "eslint:recommended",
// "plugin:react/recommended",
// "plugin:@typescript-eslint/recommended",
// "plugin:@typescript-eslint/recommended-requiring-type-checking",
"prettier" // this rule should be the last
],
"overrides": [],
Expand Down
4 changes: 0 additions & 4 deletions .husky/pre-commit

This file was deleted.

11 changes: 11 additions & 0 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
version: '3.3'
services:
api:
build:
context: ./
dockerfile: local.Dockerfile
volumes:
- ./:/app
- ./.m2:/root/.m2
working_dir: /app
command: sh run.sh
159 changes: 156 additions & 3 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,18 @@
"@testing-library/jest-dom": "^6.1.3",
"@testing-library/react": "^14.0.0",
"@testing-library/user-event": "^14.5.1",
"@types/axios": "^0.14.0",
"axios": "^1.6.2",
"eslint-config-prettier": "^9.0.0",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-hot-toast": "^2.4.1",
"react-query": "^3.39.3",
"react-redux": "^8.1.3",
"react-router-dom": "^6.16.0",
"react-scripts": "^5.0.1",
"react-simply-carousel": "^9.0.4",
"redux": "^5.0.0",
"redux-thunk": "^3.1.0",
"web-vitals": "^3.5.0"
},
Expand Down Expand Up @@ -56,6 +60,8 @@
"@types/node": "^20.8.0",
"@types/react": "^18.2.24",
"@types/react-dom": "^18.2.8",
"@types/react-query": "^1.2.9",
"@types/react-redux": "^7.1.33",
"@typescript-eslint/eslint-plugin": "^6.7.3",
"@typescript-eslint/parser": "^6.7.3",
"dotenv": "^16.3.1",
Expand Down
18 changes: 15 additions & 3 deletions src/app/api/file.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,27 @@
import axios from 'axios';
import axios, { AxiosResponse } from 'axios';
import { BACKEND_URL } from 'envConstants';


export interface FileUpload{

message: string,
isSuccessful: boolean,
statusCode: number,

}




export const uploadIcon = async (
authorizationToken: string,
orgName: string,
file: File
) => {
):Promise<AxiosResponse<FileUpload>> => {
const url = BACKEND_URL + '/api/protected/file/upload/' + orgName;
const formData = new FormData();
formData.append('file', file);
const respnse = await axios.post(url, formData, {
const respnse = await axios.post<FileUpload>(url, formData, {
headers: {
Accept: 'application/json',
Authorization: `Bearer ${authorizationToken}`,
Expand Down
Loading