Skip to content

Commit

Permalink
[change] #110
Browse files Browse the repository at this point in the history
  • Loading branch information
yoneyan committed Aug 15, 2022
1 parent 8e06cee commit 478869c
Show file tree
Hide file tree
Showing 5 changed files with 0 additions and 302 deletions.
2 changes: 0 additions & 2 deletions src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import SignIn from './pages/Login/SignIn';
import Group from "./pages/Group/Group";
import Dashboard from "./pages/Dashboard/Dashboard";
import Notice from './pages/Notice/Notice';
import Order from "./pages/Order/Order";
import GroupDetail from './pages/Group/GroupDetail/GroupDetail';
import SupportDetail from "./pages/Support/SupportDetail/SupportDetail";
import Support from "./pages/Support/Support";
Expand Down Expand Up @@ -33,7 +32,6 @@ export default class App extends React.Component {
<Route path="/dashboard/group/:id/add/connection" element={<ConnectionAdd/>}/>
<Route path="/dashboard/support" element={<Support/>}/>
<Route path="/dashboard/support/:id" element={<SupportDetail/>}/>
<Route path="/dashboard/order" element={<Order/>}/>
<Route path="/dashboard/service" element={<Service/>}/>
<Route path="/dashboard/connection" element={<Connection/>}/>
<Route path="/dashboard/user" element={<User/>}/>
Expand Down
101 changes: 0 additions & 101 deletions src/api/Payment.ts
Original file line number Diff line number Diff line change
@@ -1,107 +1,6 @@
import axios from "axios";
import {restfulApiConfig} from "./Config";
import {PaymentDetailData} from "../interface";

export function Post(data: PaymentDetailData): Promise<{ error: string; data: any }> {
return axios.post(restfulApiConfig.apiURL + "/payment", data, {
headers: {
'Content-Type': 'application/json',
ACCESS_TOKEN: sessionStorage.getItem('AccessToken')!,
}
}).then(res => {
return {
error: "",
data: res.data.service
};
}).catch(err => {
console.log(err);
return {
error: "[" + err.response.status + "] " + err.response.data.error,
data: null
};
})
}

export function Delete(id: number): Promise<{ error: string; data: any }> {
return axios.delete(restfulApiConfig.apiURL + "/payment/" + id, {
headers: {
'Content-Type': 'application/json',
ACCESS_TOKEN: sessionStorage.getItem('AccessToken')!,
}
}).then(res => {
return {
error: "",
data: res.data.service
};
}).catch(err => {
console.log(err);
return {
error: "[" + err.response.status + "] " + err.response.data.error,
data: null
};
})
}

export function Put(id: number, data: PaymentDetailData): Promise<{ error: string; data: any }> {
return axios.put(restfulApiConfig.apiURL + "/payment/" + id, data, {
headers: {
'Content-Type': 'application/json',
ACCESS_TOKEN: sessionStorage.getItem('AccessToken')!,
}
}).then(res => {
return {
error: "",
data: res.data.service
};
}).catch(err => {
console.log(err);
return {
error: err,
data: null
};
})
}

export function GetAll(): Promise<{ error: string, data: any }> {
return axios.get(restfulApiConfig.apiURL + "/payment", {
headers: {
'Content-Type': 'application/json',
ACCESS_TOKEN: sessionStorage.getItem('AccessToken')!,
}
}).then(res => {
console.log(res.data);
return {
error: "",
data: res.data.payment
};
}).catch(err => {
console.log(err);
return {
error: "[" + err.response.status + "] " + err.response.data.error,
data: null
};
})
}

export function Refund(id: number): Promise<{ error: string; data: any }> {
return axios.post(restfulApiConfig.apiURL + "/payment/" + id + "/refund", {}, {
headers: {
'Content-Type': 'application/json',
ACCESS_TOKEN: sessionStorage.getItem('AccessToken')!,
}
}).then(res => {
return {
error: "",
data: res.data.service
};
}).catch(err => {
console.log(err);
return {
error: "[" + err.response.status + "] " + err.response.data.error,
data: null
};
})
}

export function PostSubscribe(groupID: number, plan: string): Promise<{ error: string; data: any }> {
return axios.post(restfulApiConfig.apiURL + "/group/" + groupID + "/payment/subscribe", {plan}, {
Expand Down
9 changes: 0 additions & 9 deletions src/components/Dashboard/Dashboard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -147,9 +147,6 @@ export default function Dashboard(props: any) {
const GroupPage = () => {
navigate("/dashboard/group");
}
const OrderPage = () => {
navigate("/dashboard/order");
}
const SupportPage = () => {
navigate("/dashboard/support");
}
Expand Down Expand Up @@ -223,12 +220,6 @@ export default function Dashboard(props: any) {
</ListItemIcon>
<ListItemText primary="Group"/>
</ListItem>
<ListItem button onClick={OrderPage}>
<ListItemIcon>
<ShoppingCartIcon/>
</ListItemIcon>
<ListItemText primary="Orders"/>
</ListItem>
<ListItem button onClick={SupportPage}>
<ListItemIcon>
<ChatIcon/>
Expand Down
13 changes: 0 additions & 13 deletions src/interface.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,19 +47,6 @@ export interface UserDetailData {
tokens?: TokenDetailData[]
}

export interface PaymentDetailData {
ID: number,
CreatedAt: string,
UpdatedAt: string,
group?: GroupDetailData,
is_membership: boolean,
paid: boolean,
refund: boolean,
fee: number,
payment_intent_id: string,
comment: string,
}

export interface TokenDetailData {
CreatedAt: string,
ID: number,
Expand Down
177 changes: 0 additions & 177 deletions src/pages/Order/Order.tsx

This file was deleted.

0 comments on commit 478869c

Please sign in to comment.