박권수

feat. API implement

1 +module.exports = {
2 + "env": {
3 + "browser": true,
4 + "es2021": true
5 + },
6 + "extends": [
7 + "eslint:recommended",
8 + "plugin:react/recommended",
9 + "plugin:@typescript-eslint/recommended"
10 + ],
11 + "parser": "@typescript-eslint/parser",
12 + "parserOptions": {
13 + "ecmaFeatures": {
14 + "jsx": true
15 + },
16 + "ecmaVersion": 12,
17 + "sourceType": "module"
18 + },
19 + "plugins": [
20 + "react",
21 + "@typescript-eslint"
22 + ],
23 + "rules": {
24 + }
25 +};
This diff could not be displayed because it is too large.
...@@ -41,5 +41,11 @@ ...@@ -41,5 +41,11 @@
41 "last 1 firefox version", 41 "last 1 firefox version",
42 "last 1 safari version" 42 "last 1 safari version"
43 ] 43 ]
44 + },
45 + "devDependencies": {
46 + "@typescript-eslint/eslint-plugin": "^4.29.1",
47 + "@typescript-eslint/parser": "^4.29.1",
48 + "eslint": "^7.32.0",
49 + "eslint-plugin-react": "^7.24.0"
44 } 50 }
45 } 51 }
......
1 import { client } from "./client"; 1 import { client } from "./client";
2 2
3 export const authApi = { 3 export const authApi = {
4 - register : (Data : Object) => { 4 + register : (Data : FormData) => {
5 return client.post('/auth/register', Data); 5 return client.post('/auth/register', Data);
6 }, 6 },
7 7
8 - login : (Data : Object) => { 8 + registerDoctor : (Data : FormData) => {
9 + return client.post('/auth/register/doctor', Data);
10 + },
11 +
12 + login : (Data : FormData) => {
9 return client.post('/auth/login', Data); 13 return client.post('/auth/login', Data);
10 }, 14 },
11 15
......
1 +import { client } from "./client";
2 +import { RecoilState } from "recoil";
3 +
4 +export const doctorApi = {
5 + getPatientList : (token : RecoilState<any>) => {
6 + return client.get('/doctor/patient', {
7 + headers : {
8 + Authorization : token,
9 + },
10 + });
11 + },
12 + getPatientDetail : (token : RecoilState<any>, PatientId : string) => {
13 + return client.get(`/doctor/patient/${PatientId}`, {
14 + headers : {
15 + Authorization : token,
16 + },
17 + });
18 + },
19 + getPatientBottleDetail : (token : RecoilState<any>, BottleId : string) => {
20 + return client.get(`/doctor/bottle/${BottleId}`, {
21 + headers : {
22 + Authorization : token,
23 + },
24 + });
25 + },
26 + writePatientInfo : (token : RecoilState<any>, Data : FormData) => {
27 + return client.patch('/doctor/patient', Data, {
28 + headers : {
29 + Authorization : token,
30 + },
31 + });
32 + },
33 + writeBottleFeedback : (token : RecoilState<any>, Data : FormData) => {
34 + return client.post('/doctor/bottle', Data, {
35 + headers : {
36 + Authorization : token,
37 + },
38 + });
39 + },
40 + registerPatient : (token : RecoilState<any>, Data : FormData) => {
41 + return client.post('/doctor/patient', Data, {
42 + headers : {
43 + Authorization : token,
44 + },
45 + });
46 + },
47 + removePatient : (token : RecoilState<any>, PatientId : string) => {
48 + return client.delete(`/doctor/patient/${PatientId}`, {
49 + headers : {
50 + Authorization : token,
51 + },
52 + });
53 + },
54 +};
...\ No newline at end of file ...\ No newline at end of file
...@@ -5,8 +5,22 @@ export const userApi = { ...@@ -5,8 +5,22 @@ export const userApi = {
5 getMyInfo : (token : RecoilState<any>) => { 5 getMyInfo : (token : RecoilState<any>) => {
6 return client.get('/user', { 6 return client.get('/user', {
7 headers : { 7 headers : {
8 - authorization : token, 8 + Authorization : token,
9 }, 9 },
10 }); 10 });
11 }, 11 },
12 + getDoctorRegisterRequest : (token : RecoilState<any>) => {
13 + return client.get('/user/doctorrequest', {
14 + headers : {
15 + Authorization : token,
16 + },
17 + });
18 + },
19 + acceptDoctorRegister : (token : RecoilState<any>, Data : FormData) => {
20 + return client.post('/user/doctorrequest/', Data, {
21 + headers : {
22 + Authorization : token,
23 + }
24 + });
25 + },
12 }; 26 };
...\ No newline at end of file ...\ No newline at end of file
......
This diff could not be displayed because it is too large.