Merge branch 'dev' into 'main'
process.env.REACT_APP_DOMAIN See merge request frontend/admin!50
This commit is contained in:
commit
b637a4cd5d
1
.env.development.local
Normal file
1
.env.development.local
Normal file
@ -0,0 +1 @@
|
|||||||
|
REACT_APP_DOMAIN="https://sadmin.pena"
|
1
.env.production.local
Normal file
1
.env.production.local
Normal file
@ -0,0 +1 @@
|
|||||||
|
REACT_APP_DOMAIN="https://sadmin.pena"
|
2
.gitignore
vendored
2
.gitignore
vendored
@ -14,9 +14,7 @@
|
|||||||
|
|
||||||
.DS_Store
|
.DS_Store
|
||||||
.env.local
|
.env.local
|
||||||
.env.development.local
|
|
||||||
.env.test.local
|
.env.test.local
|
||||||
.env.production.local
|
|
||||||
|
|
||||||
npm-debug.log*
|
npm-debug.log*
|
||||||
yarn-debug.log*
|
yarn-debug.log*
|
||||||
|
@ -100,7 +100,7 @@ describe("Форма регистрации", () => {
|
|||||||
cy.get('input[name="password"]').type(password);
|
cy.get('input[name="password"]').type(password);
|
||||||
cy.get('input[name="repeatPassword"]').type(password);
|
cy.get('input[name="repeatPassword"]').type(password);
|
||||||
|
|
||||||
cy.intercept("POST", "https://admin.pena.digital/auth/register").as("registerRequest");
|
cy.intercept("POST", process.env.REACT_APP_DOMAIN + "/auth/register").as("registerRequest");
|
||||||
cy.get('button[type="submit"]').click();
|
cy.get('button[type="submit"]').click();
|
||||||
cy.wait("@registerRequest");
|
cy.wait("@registerRequest");
|
||||||
|
|
||||||
|
@ -10,7 +10,7 @@ describe("tests", () => {
|
|||||||
beforeEach(async () => {
|
beforeEach(async () => {
|
||||||
await axios({
|
await axios({
|
||||||
method: "post",
|
method: "post",
|
||||||
url: "https://admin.pena.digital/heruvym/getTickets",
|
url: process.env.REACT_APP_DOMAIN + "/heruvym/getTickets",
|
||||||
data: {
|
data: {
|
||||||
amt: 20,
|
amt: 20,
|
||||||
page: 0,
|
page: 0,
|
||||||
@ -23,7 +23,7 @@ describe("tests", () => {
|
|||||||
|
|
||||||
await axios({
|
await axios({
|
||||||
method: "post",
|
method: "post",
|
||||||
url: "https://admin.pena.digital/heruvym/getMessages",
|
url: process.env.REACT_APP_DOMAIN + "/heruvym/getMessages",
|
||||||
data: {
|
data: {
|
||||||
amt: 100,
|
amt: 100,
|
||||||
page: 0,
|
page: 0,
|
||||||
|
@ -30,10 +30,7 @@ export type Account = {
|
|||||||
wallet: Wallet;
|
wallet: Wallet;
|
||||||
};
|
};
|
||||||
|
|
||||||
const baseUrl =
|
const baseUrl = process.env.REACT_APP_DOMAIN + "/customer"
|
||||||
process.env.NODE_ENV === "production"
|
|
||||||
? "/customer"
|
|
||||||
: "https://admin.pena.digital/customer";
|
|
||||||
|
|
||||||
export const getAccountInfo = async (
|
export const getAccountInfo = async (
|
||||||
id: string
|
id: string
|
||||||
|
@ -8,10 +8,7 @@ import type {
|
|||||||
RegisterResponse,
|
RegisterResponse,
|
||||||
} from "@frontend/kitui";
|
} from "@frontend/kitui";
|
||||||
|
|
||||||
const baseUrl =
|
const baseUrl = process.env.REACT_APP_DOMAIN + "/auth"
|
||||||
process.env.NODE_ENV === "production"
|
|
||||||
? "/auth"
|
|
||||||
: "https://admin.pena.digital/auth";
|
|
||||||
|
|
||||||
export const signin = async (
|
export const signin = async (
|
||||||
login: string,
|
login: string,
|
||||||
|
@ -9,10 +9,7 @@ import type {
|
|||||||
GetDiscountResponse,
|
GetDiscountResponse,
|
||||||
} from "@root/model/discount";
|
} from "@root/model/discount";
|
||||||
|
|
||||||
const baseUrl =
|
const baseUrl = process.env.REACT_APP_DOMAIN + "/price"
|
||||||
process.env.NODE_ENV === "production"
|
|
||||||
? "/price"
|
|
||||||
: "https://admin.pena.digital/price";
|
|
||||||
|
|
||||||
interface CreateDiscountParams {
|
interface CreateDiscountParams {
|
||||||
purchasesAmount: number;
|
purchasesAmount: number;
|
||||||
|
@ -10,10 +10,7 @@ type SeverPrivilegesResponse = {
|
|||||||
squiz: PrivilegeWithAmount[];
|
squiz: PrivilegeWithAmount[];
|
||||||
};
|
};
|
||||||
|
|
||||||
const baseUrl =
|
const baseUrl = process.env.REACT_APP_DOMAIN + "/strator"
|
||||||
process.env.NODE_ENV === "production"
|
|
||||||
? "/strator"
|
|
||||||
: "https://admin.pena.digital/strator";
|
|
||||||
|
|
||||||
export const getRoles = async (): Promise<[TMockData | null, string?]> => {
|
export const getRoles = async (): Promise<[TMockData | null, string?]> => {
|
||||||
try {
|
try {
|
||||||
|
@ -35,10 +35,7 @@ export type UserType = {
|
|||||||
updatedAt: string;
|
updatedAt: string;
|
||||||
};
|
};
|
||||||
|
|
||||||
const baseUrl =
|
const baseUrl =process.env.REACT_APP_DOMAIN + "/role"
|
||||||
process.env.NODE_ENV === "production"
|
|
||||||
? "/role"
|
|
||||||
: "https://admin.pena.digital/role";
|
|
||||||
|
|
||||||
export const getRoles_mock = (): Promise<TMockData> => {
|
export const getRoles_mock = (): Promise<TMockData> => {
|
||||||
return new Promise((resolve) => {
|
return new Promise((resolve) => {
|
||||||
|
@ -20,10 +20,7 @@ type GetTariffsResponse = {
|
|||||||
tariffs: Tariff[];
|
tariffs: Tariff[];
|
||||||
};
|
};
|
||||||
|
|
||||||
const baseUrl =
|
const baseUrl =process.env.REACT_APP_DOMAIN + "/strator"
|
||||||
process.env.NODE_ENV === "production"
|
|
||||||
? "/strator"
|
|
||||||
: "https://admin.pena.digital/strator";
|
|
||||||
|
|
||||||
export const createTariff = async (
|
export const createTariff = async (
|
||||||
body: CreateTariffBackendRequest
|
body: CreateTariffBackendRequest
|
||||||
|
@ -4,10 +4,7 @@ import { parseAxiosError } from "@root/utils/parse-error";
|
|||||||
|
|
||||||
import type { SendTicketMessageRequest } from "@root/model/ticket";
|
import type { SendTicketMessageRequest } from "@root/model/ticket";
|
||||||
|
|
||||||
const baseUrl =
|
const baseUrl = process.env.REACT_APP_DOMAIN + "/heruvym"
|
||||||
process.env.NODE_ENV === "production"
|
|
||||||
? "/heruvym"
|
|
||||||
: "https://admin.pena.digital/heruvym";
|
|
||||||
|
|
||||||
export const sendTicketMessage = async (
|
export const sendTicketMessage = async (
|
||||||
body: SendTicketMessageRequest
|
body: SendTicketMessageRequest
|
||||||
|
@ -9,10 +9,7 @@ type RegisteredUsersResponse = {
|
|||||||
users: UserType[];
|
users: UserType[];
|
||||||
};
|
};
|
||||||
|
|
||||||
const baseUrl =
|
const baseUrl = process.env.REACT_APP_DOMAIN + "/user";
|
||||||
process.env.NODE_ENV === "production"
|
|
||||||
? "/user"
|
|
||||||
: "https://admin.pena.digital/user";
|
|
||||||
|
|
||||||
export const getUserInfo = async (
|
export const getUserInfo = async (
|
||||||
id: string
|
id: string
|
||||||
|
@ -25,10 +25,7 @@ type PatchVerificationBody = {
|
|||||||
taxnumber?: string;
|
taxnumber?: string;
|
||||||
};
|
};
|
||||||
|
|
||||||
const baseUrl =
|
const baseUrl = process.env.REACT_APP_DOMAIN + "/verification"
|
||||||
process.env.NODE_ENV === "production"
|
|
||||||
? "/verification"
|
|
||||||
: "https://admin.pena.digital/verification";
|
|
||||||
|
|
||||||
export const verification = async (
|
export const verification = async (
|
||||||
userId: string
|
userId: string
|
||||||
|
@ -20,7 +20,7 @@ const ConditionalRender = ({
|
|||||||
// useEffect(() => {
|
// useEffect(() => {
|
||||||
// const axiosAccount = async () => {
|
// const axiosAccount = async () => {
|
||||||
// try {
|
// try {
|
||||||
// const { data } = await axios.get("https://admin.pena.digital/user/643e23f3dba63ba17272664d");
|
// const { data } = await axios.get(process.env.REACT_APP_DOMAIN + "/user/643e23f3dba63ba17272664d");
|
||||||
// setRole(data.role);
|
// setRole(data.role);
|
||||||
// } catch (error) {
|
// } catch (error) {
|
||||||
// console.error("Ошибка при получение роли пользавателя");
|
// console.error("Ошибка при получение роли пользавателя");
|
||||||
|
@ -30,7 +30,7 @@ export default function Chat() {
|
|||||||
const ticket = tickets.find(ticket => ticket.id === ticketId);
|
const ticket = tickets.find(ticket => ticket.id === ticketId);
|
||||||
|
|
||||||
useTicketMessages({
|
useTicketMessages({
|
||||||
url: "https://admin.pena.digital/heruvym/getMessages",
|
url: process.env.REACT_APP_DOMAIN + "/heruvym/getMessages",
|
||||||
ticketId,
|
ticketId,
|
||||||
messagesPerPage,
|
messagesPerPage,
|
||||||
messageApiPage,
|
messageApiPage,
|
||||||
@ -47,7 +47,7 @@ export default function Chat() {
|
|||||||
|
|
||||||
useSSESubscription<TicketMessage>({
|
useSSESubscription<TicketMessage>({
|
||||||
enabled: Boolean(token) && Boolean(ticketId),
|
enabled: Boolean(token) && Boolean(ticketId),
|
||||||
url: `https://admin.pena.digital/heruvym/ticket?ticket=${ticketId}&Authorization=${token}`,
|
url: process.env.REACT_APP_DOMAIN + `/heruvym/ticket?ticket=${ticketId}&Authorization=${token}`,
|
||||||
onNewData: addOrUpdateMessages,
|
onNewData: addOrUpdateMessages,
|
||||||
onDisconnect: () => {
|
onDisconnect: () => {
|
||||||
clearMessageState();
|
clearMessageState();
|
||||||
|
@ -16,7 +16,7 @@ export default function Support() {
|
|||||||
const token = useToken();
|
const token = useToken();
|
||||||
|
|
||||||
useTicketsFetcher({
|
useTicketsFetcher({
|
||||||
url: "https://admin.pena.digital/heruvym/getTickets",
|
url: process.env.REACT_APP_DOMAIN + "/heruvym/getTickets",
|
||||||
ticketsPerPage,
|
ticketsPerPage,
|
||||||
ticketApiPage,
|
ticketApiPage,
|
||||||
onSuccess: result => {
|
onSuccess: result => {
|
||||||
@ -31,7 +31,7 @@ export default function Support() {
|
|||||||
|
|
||||||
useSSESubscription<Ticket>({
|
useSSESubscription<Ticket>({
|
||||||
enabled: Boolean(token),
|
enabled: Boolean(token),
|
||||||
url: `https://admin.pena.digital/heruvym/subscribe?Authorization=${token}`,
|
url: process.env.REACT_APP_DOMAIN + `/heruvym/subscribe?Authorization=${token}`,
|
||||||
onNewData: updateTickets,
|
onNewData: updateTickets,
|
||||||
onDisconnect: () => {
|
onDisconnect: () => {
|
||||||
clearMessageState();
|
clearMessageState();
|
||||||
|
@ -65,7 +65,7 @@ export const VerificationTab = ({ userId }: VerificationTabProps) => {
|
|||||||
if (accepted && _ === "OK") await makeRequest({
|
if (accepted && _ === "OK") await makeRequest({
|
||||||
method: "patch",
|
method: "patch",
|
||||||
useToken: true,
|
useToken: true,
|
||||||
url: `https://admin.pena.digital/customer/account/${userId}`,
|
url: process.env.REACT_APP_DOMAIN + `/customer/account/${userId}`,
|
||||||
body: {status: verificationInfo.status}
|
body: {status: verificationInfo.status}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user