initial commit
This commit is contained in:
19
repository/ask.js
Normal file
19
repository/ask.js
Normal file
@@ -0,0 +1,19 @@
|
||||
import {http} from "../utils/http";
|
||||
|
||||
const url = {
|
||||
contacts: () => '/product/api/v5/customer-service'
|
||||
}
|
||||
|
||||
const hooks = {}
|
||||
|
||||
const api = {
|
||||
async getContacts() {
|
||||
return await http.fetcher(url.contacts())
|
||||
},
|
||||
}
|
||||
|
||||
export const askRepository = {
|
||||
url,
|
||||
hooks,
|
||||
api
|
||||
}
|
||||
31
repository/bots.js
Normal file
31
repository/bots.js
Normal file
@@ -0,0 +1,31 @@
|
||||
import {http} from "../utils/http";
|
||||
import useSWR from "swr";
|
||||
|
||||
const url = {
|
||||
findAllLockeyInLocations: (qrCode) => `/bots/find-all/Lockey/${qrCode}`,
|
||||
findLocationByQrCode: (qrCode) => `/locations/findOne/${qrCode}`,
|
||||
createOrder: () => `/bots/create-order`,
|
||||
checkTransaction: (orderId) => `/bots/find/one-history/${orderId}`,
|
||||
}
|
||||
|
||||
const hooks = {
|
||||
useGetAllLockey(qrCode) {
|
||||
return useSWR(url.findAllLockeyInLocations(qrCode), http.fetcher);
|
||||
},
|
||||
useGetLocationByQR(qrCode) {
|
||||
return useSWR(url.findLocationByQrCode(qrCode), http.fetcher);
|
||||
}
|
||||
}
|
||||
|
||||
const api = {
|
||||
async useCheckTransactionByOrderId(orderId) {
|
||||
const res = await http.fetcher(url.checkTransaction(orderId));
|
||||
return res
|
||||
},
|
||||
}
|
||||
|
||||
export const botsRepository = {
|
||||
url,
|
||||
hooks,
|
||||
api
|
||||
}
|
||||
19
repository/order.js
Normal file
19
repository/order.js
Normal file
@@ -0,0 +1,19 @@
|
||||
import {http} from "../utils/http";
|
||||
|
||||
const url = {
|
||||
payment: () => '/usermanagement/api/v5/validate/check-phone-register'
|
||||
}
|
||||
|
||||
const hooks = {}
|
||||
|
||||
const api = {
|
||||
async usePayment(data) {
|
||||
return await http.post(url.payment, data)
|
||||
},
|
||||
}
|
||||
|
||||
export const orderRepository = {
|
||||
url,
|
||||
hooks,
|
||||
api
|
||||
}
|
||||
Reference in New Issue
Block a user