Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mb/api migration #2723

Merged
merged 9 commits into from Jan 30, 2024
Merged

Mb/api migration #2723

merged 9 commits into from Jan 30, 2024

Conversation

moazzambukhari
Copy link
Contributor

@moazzambukhari moazzambukhari commented Jul 20, 2023

What does this PR?

End points that need to migration

Where should the reviewer start?

  • ecency.ts
  • ePoint.ts

Steps to reproduce

Issue number

#2723

Screenshots/Video

export const gameStatusCheck = async (game_type: string) => {
try {
const data = { game_type };
const res = await ecencyApi.post('/private-api/get-game', data);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

data object is being sent as post request body here since request if of type POST, you can either merge params with url path or add them in config as params, that is usually third argument of an axios post method.

export const gameClaim = async (game_type: string) => {
try {
const data = { game_type };
const res = await ecencyApi.post('/private-api/get-game', data);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same mistake here...{game_type} should be sent as params while {key} should the data passed body

export const addReport = async (type: 'content' | 'user', data: string) => {
try {
const response = await api.post('/report', {
const response = await api.post('/private-api/report', {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use ecencyApi instead api

* data:string
*
**/
export const deleteAccount = async (data: string, username: string) => {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. username should be first argument to avoid conflict from previous calls
  2. use ecencyApi instead api

// .catch((error) => bugsnagInstance.notify(error));

export const purchaseOrder = async (data: PurchaseRequestData, platform: string, product: string, receipt: string, user: string) => {
const orderData = {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. there is no source to initialise this object, data is never used here.
  2. request properties is already a part of data passed to method

Copy link
Collaborator

@noumantahir noumantahir left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can be merged for now, reverted api endpoint that are not working properly when migration to private-api..

@feruzm feruzm merged commit 7cda162 into development Jan 30, 2024
@feruzm feruzm deleted the mb/api-migration branch January 30, 2024 08:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants