Skip to content

Commit

Permalink
changed actions to call secure.ecanna.com.br
Browse files Browse the repository at this point in the history
  • Loading branch information
baufaker committed Apr 25, 2024
1 parent 6994fc8 commit e5f2d65
Show file tree
Hide file tree
Showing 38 changed files with 113 additions and 153 deletions.
2 changes: 1 addition & 1 deletion actions/adminGetAssociation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ const getAssociation = async (
): Promise<AssociationAdmin> => {
try {
const response = await fetch(
`http://development.eba-93ecmjzh.us-east-1.elasticbeanstalk.com/associations/admin/${id}`,
`https://service.ecanna.com.br/associations/admin/${id}`,
{
method: "GET",
headers: {
Expand Down
6 changes: 2 additions & 4 deletions actions/adminGetAssociationUsers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,15 +35,13 @@ const getAssociation = async (
_req: Request,
): Promise<AssociationUsersResponse> => {
try {
let url =
`http://development.eba-93ecmjzh.us-east-1.elasticbeanstalk.com/profile/admin`;
let url = `https://service.ecanna.com.br/profile/admin`;

if (params) {
const query = `?limit=${params.limit}&page=${params.page}${
params.email && `&email=${params.email}`
}`;
url =
`http://development.eba-93ecmjzh.us-east-1.elasticbeanstalk.com/profile/admin${query}`;
url = `https://service.ecanna.com.br/profile/admin${query}`;
}

const response = await fetch(url, {
Expand Down
6 changes: 2 additions & 4 deletions actions/adminGetOrders.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,15 +52,13 @@ const adminGetOrders = async (
{ token, params }: Props,
_req: Request,
): Promise<PaginationOrderResponse> => {
let url =
`http://development.eba-93ecmjzh.us-east-1.elasticbeanstalk.com/admin/orders/`;
let url = `https://service.ecanna.com.br/admin/orders/`;

if (params) {
const query = `?limit=${params.limit}&page=${params.page}${
params.status && `&status=${params.status}`
}`;
url =
`http://development.eba-93ecmjzh.us-east-1.elasticbeanstalk.com/admin/orders${query}`;
url = `https://service.ecanna.com.br/admin/orders${query}`;
}

try {
Expand Down
2 changes: 1 addition & 1 deletion actions/adminUpdateAssociation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ const getAssociation = async (
): Promise<unknown> => {
try {
const response = await fetch(
`http://development.eba-93ecmjzh.us-east-1.elasticbeanstalk.com/associations/admin/${id}`,
`https://service.ecanna.com.br/associations/admin/${id}`,
{
method: "PUT",
body: JSON.stringify(body),
Expand Down
2 changes: 1 addition & 1 deletion actions/changePassword.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ const changePassword = async (
): Promise<unknown | null> => {
try {
const response = await fetch(
"http://development.eba-93ecmjzh.us-east-1.elasticbeanstalk.com/auth/change-password",
"https://service.ecanna.com.br/auth/change-password",
{
method: "PUT",
body: JSON.stringify(body),
Expand Down
2 changes: 1 addition & 1 deletion actions/changeSubscription.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ const changeSubscription = async (
delete params.token;
try {
const response = await fetch(
"http://development.eba-93ecmjzh.us-east-1.elasticbeanstalk.com/checkout/upgrade",
"https://service.ecanna.com.br/checkout/upgrade",
{
method: "POST",
headers: {
Expand Down
15 changes: 6 additions & 9 deletions actions/checkout.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,16 +36,13 @@ const checkout = async (
_req: Request,
): Promise<unknown | null> => {
try {
const response = await fetch(
"http://development.eba-93ecmjzh.us-east-1.elasticbeanstalk.com/checkout",
{
method: "POST",
headers: {
"Content-Type": "application/json",
},
body: JSON.stringify(props),
const response = await fetch("https://service.ecanna.com.br/checkout", {
method: "POST",
headers: {
"Content-Type": "application/json",
},
);
body: JSON.stringify(props),
});

const res = await response.json();
return res;
Expand Down
17 changes: 7 additions & 10 deletions actions/checkoutv2.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,17 +33,14 @@ const checkoutv2 = async (
console.log({ params });

try {
const response = await fetch(
"http://development.eba-93ecmjzh.us-east-1.elasticbeanstalk.com/checkout/v2",
{
method: "POST",
headers: {
"Content-Type": "application/json",
Authorization: props.token || "",
},
body: JSON.stringify(params),
const response = await fetch("https://service.ecanna.com.br/checkout/v2", {
method: "POST",
headers: {
"Content-Type": "application/json",
Authorization: props.token || "",
},
);
body: JSON.stringify(params),
});

const res = await response.json();
return res;
Expand Down
2 changes: 1 addition & 1 deletion actions/cognitoAdminSignIn.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ const signInCognito = async (
): Promise<unknown | null> => {
try {
const response = await fetch(
"http://development.eba-93ecmjzh.us-east-1.elasticbeanstalk.com/admin/sign-in",
"https://service.ecanna.com.br/admin/sign-in",
{
method: "POST",
headers: {
Expand Down
21 changes: 9 additions & 12 deletions actions/cognitoSignIn.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,16 @@ const signInCognito = async (
_req: Request,
): Promise<unknown | null> => {
try {
const response = await fetch(
"http://development.eba-93ecmjzh.us-east-1.elasticbeanstalk.com/auth/sign-in",
{
method: "POST",
headers: {
"Content-Type": "application/json",
},
body: JSON.stringify({
email: props.email,
password: props.password,
}),
const response = await fetch("https://service.ecanna.com.br/auth/sign-in", {
method: "POST",
headers: {
"Content-Type": "application/json",
},
);
body: JSON.stringify({
email: props.email,
password: props.password,
}),
});

const res = await response.json();
return res;
Expand Down
25 changes: 11 additions & 14 deletions actions/cognitoSignUp.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,21 +10,18 @@ const signUpCognito = async (
_req: Request,
): Promise<unknown | null> => {
try {
const response = await fetch(
"http://development.eba-93ecmjzh.us-east-1.elasticbeanstalk.com/auth",
{
method: "POST",
headers: {
"Content-Type": "application/json",
},
body: JSON.stringify({
email: props.email,
password: props.password,
name: props.name,
cpf: props.cpf,
}),
const response = await fetch("https://service.ecanna.com.br/auth", {
method: "POST",
headers: {
"Content-Type": "application/json",
},
);
body: JSON.stringify({
email: props.email,
password: props.password,
name: props.name,
cpf: props.cpf,
}),
});

const res = await response.json();
return res;
Expand Down
2 changes: 1 addition & 1 deletion actions/confirmCognitoSignup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ const confirmCognitoSignup = async (
): Promise<unknown | null> => {
try {
const response = await fetch(
"http://development.eba-93ecmjzh.us-east-1.elasticbeanstalk.com/auth/confirm-signup",
"https://service.ecanna.com.br/auth/confirm-signup",
{
method: "POST",
headers: {
Expand Down
2 changes: 1 addition & 1 deletion actions/confirmForgotPassword.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ const confirmForgotPassword = async (
): Promise<unknown | null> => {
try {
const response = await fetch(
"http://development.eba-93ecmjzh.us-east-1.elasticbeanstalk.com/auth/forgot-password/confirm",
"https://service.ecanna.com.br/auth/forgot-password/confirm",
{
method: "POST",
headers: {
Expand Down
2 changes: 1 addition & 1 deletion actions/deleteAssociationDocument.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ const deleteAssociationDocument = async (
console.log({ docId: props.docId });
try {
const response = await fetch(
`http://development.eba-93ecmjzh.us-east-1.elasticbeanstalk.com/documents/association/${props.docId}`,
`https://service.ecanna.com.br/documents/association/${props.docId}`,
{
method: "DELETE",
headers: {
Expand Down
2 changes: 1 addition & 1 deletion actions/deleteDocument.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ const deleteDocument = async (
console.log({ docId: props.docId });
try {
const response = await fetch(
`http://development.eba-93ecmjzh.us-east-1.elasticbeanstalk.com/documents/${props.docId}`,
`https://service.ecanna.com.br/documents/${props.docId}`,
{
method: "DELETE",
headers: {
Expand Down
2 changes: 1 addition & 1 deletion actions/forgotPassword.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ const forgotPassword = async (
): Promise<unknown | null> => {
try {
const response = await fetch(
"http://development.eba-93ecmjzh.us-east-1.elasticbeanstalk.com/auth/forgot-password",
"https://service.ecanna.com.br/auth/forgot-password",
{
method: "POST",
headers: {
Expand Down
2 changes: 1 addition & 1 deletion actions/getAssociation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ const getAssociation = async (
): Promise<unknown | null> => {
try {
const response = await fetch(
`http://development.eba-93ecmjzh.us-east-1.elasticbeanstalk.com/associations/${id}`,
`https://service.ecanna.com.br/associations/${id}`,
{
method: "GET",
headers: {
Expand Down
2 changes: 1 addition & 1 deletion actions/getAssociationDocs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ const getDocs = async (
): Promise<unknown | null> => {
try {
const response = await fetch(
`http://development.eba-93ecmjzh.us-east-1.elasticbeanstalk.com/documents/association/${associationId}`,
`https://service.ecanna.com.br/documents/association/${associationId}`,
{
method: "GET",
headers: {
Expand Down
2 changes: 1 addition & 1 deletion actions/getCardProduct.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
const getPlans = async (_req: Request): Promise<unknown | null> => {
try {
const response = await fetch(
"http://development.eba-93ecmjzh.us-east-1.elasticbeanstalk.com/products/cards",
"https://service.ecanna.com.br/products/cards",
{
method: "GET",
headers: {
Expand Down
2 changes: 1 addition & 1 deletion actions/getCids.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ const getCids = async (
): Promise<unknown | null> => {
try {
const response = await fetch(
`http://development.eba-93ecmjzh.us-east-1.elasticbeanstalk.com/cids?name=${term}`,
`https://service.ecanna.com.br/cids?name=${term}`,
{
method: "GET",
headers: {
Expand Down
15 changes: 6 additions & 9 deletions actions/getDocs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,13 @@ const getDocs = async (
_req: Request,
): Promise<unknown | null> => {
try {
const response = await fetch(
"http://development.eba-93ecmjzh.us-east-1.elasticbeanstalk.com/documents",
{
method: "GET",
headers: {
"Content-Type": "application/json",
Authorization: token,
},
const response = await fetch("https://service.ecanna.com.br/documents", {
method: "GET",
headers: {
"Content-Type": "application/json",
Authorization: token,
},
);
});

const res = await response.json();
return res;
Expand Down
2 changes: 1 addition & 1 deletion actions/getPlans.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
const getPlans = async (_req: Request): Promise<unknown | null> => {
try {
const response = await fetch(
"http://development.eba-93ecmjzh.us-east-1.elasticbeanstalk.com/products/subscriptions",
"https://service.ecanna.com.br/products/subscriptions",
{
method: "GET",
headers: {
Expand Down
15 changes: 6 additions & 9 deletions actions/getProfile.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,13 @@ const getUser = async (
_req: Request,
): Promise<unknown | null> => {
try {
const response = await fetch(
"http://development.eba-93ecmjzh.us-east-1.elasticbeanstalk.com/profile",
{
method: "GET",
headers: {
"Content-Type": "application/json",
Authorization: token,
},
const response = await fetch("https://service.ecanna.com.br/profile", {
method: "GET",
headers: {
"Content-Type": "application/json",
Authorization: token,
},
);
});

const res = await response.json();
return res;
Expand Down
15 changes: 6 additions & 9 deletions actions/getUser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,13 @@ const getUser = async (
_req: Request,
): Promise<unknown | null> => {
try {
const response = await fetch(
"http://development.eba-93ecmjzh.us-east-1.elasticbeanstalk.com/auth/me",
{
method: "GET",
headers: {
"Content-Type": "application/json",
Authorization: token,
},
const response = await fetch("https://service.ecanna.com.br/auth/me", {
method: "GET",
headers: {
"Content-Type": "application/json",
Authorization: token,
},
);
});

const res = await response.json();
return res;
Expand Down
15 changes: 6 additions & 9 deletions actions/getUserAdmin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,13 @@ const getUser = async (
_req: Request,
): Promise<unknown | null> => {
try {
const response = await fetch(
"http://development.eba-93ecmjzh.us-east-1.elasticbeanstalk.com/v1/admin/me",
{
method: "GET",
headers: {
"Content-Type": "application/json",
Authorization: token,
},
const response = await fetch("https://service.ecanna.com.br/v1/admin/me", {
method: "GET",
headers: {
"Content-Type": "application/json",
Authorization: token,
},
);
});

const res = await response.json();
return res;
Expand Down
15 changes: 6 additions & 9 deletions actions/getUserOrders.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,16 +47,13 @@ const getUserOrders = async (
_req: Request,
): Promise<PaginationOrderResponse> => {
try {
const response = await fetch(
"http://development.eba-93ecmjzh.us-east-1.elasticbeanstalk.com/orders/",
{
method: "GET",
headers: {
"Content-Type": "application/json",
Authorization: token,
},
const response = await fetch("https://service.ecanna.com.br/orders/", {
method: "GET",
headers: {
"Content-Type": "application/json",
Authorization: token,
},
);
});

const res = await response.json();
return res;
Expand Down
Loading

0 comments on commit e5f2d65

Please sign in to comment.