Skip to content

Commit

Permalink
changes
Browse files Browse the repository at this point in the history
  • Loading branch information
leonardocustodio committed Aug 12, 2023
1 parent df9da78 commit c44d865
Show file tree
Hide file tree
Showing 8 changed files with 42 additions and 37 deletions.
2 changes: 1 addition & 1 deletion resources/js/api/auth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import queries from './queries';

export class AuthApi {
static async sendPlatfromRequest(data: Record<string, unknown>) {
return ApiService.sendPlatfromRequest(data, '/multi-tenant');
return ApiService.sendPlatformRequest(data, '/multi-tenant');
}

static async login(email: string, password: string) {
Expand Down
2 changes: 1 addition & 1 deletion resources/js/api/beam.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import queries from './queries';

export class BeamApi {
static async sendPlatfromRequest(data: Record<string, unknown>) {
return ApiService.sendPlatfromRequest(data, '/beam');
return ApiService.sendPlatformRequest(data, '/beam');
}

static async getBeam(getBeamData: Record<string, unknown>) {
Expand Down
22 changes: 11 additions & 11 deletions resources/js/api/collection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export class CollectionApi {
},
};

return ApiService.sendPlatfromRequest(data);
return ApiService.sendPlatformRequest(data);
}

static async getCollectionsIds(first: number = 20) {
Expand All @@ -23,7 +23,7 @@ export class CollectionApi {
},
};

return ApiService.sendPlatfromRequest(data);
return ApiService.sendPlatformRequest(data);
}

static async getCollection(collectionId: string) {
Expand All @@ -34,7 +34,7 @@ export class CollectionApi {
},
};

return ApiService.sendPlatfromRequest(data);
return ApiService.sendPlatformRequest(data);
}

static async createCollection(collectionData: Record<string, unknown>) {
Expand All @@ -50,7 +50,7 @@ export class CollectionApi {
},
};

return ApiService.sendPlatfromRequest(data);
return ApiService.sendPlatformRequest(data);
}

static async approveCollection(collectionData: Record<string, unknown>) {
Expand All @@ -65,7 +65,7 @@ export class CollectionApi {
},
};

return ApiService.sendPlatfromRequest(data);
return ApiService.sendPlatformRequest(data);
}

static async unapproveCollection(collectionData: Record<string, unknown>) {
Expand All @@ -79,7 +79,7 @@ export class CollectionApi {
},
};

return ApiService.sendPlatfromRequest(data);
return ApiService.sendPlatformRequest(data);
}

static async destroyCollection(collectionData: Record<string, unknown>) {
Expand All @@ -92,7 +92,7 @@ export class CollectionApi {
},
};

return ApiService.sendPlatfromRequest(data);
return ApiService.sendPlatformRequest(data);
}

static async mutateCollection(collectionData: Record<string, unknown>) {
Expand All @@ -106,7 +106,7 @@ export class CollectionApi {
},
};

return ApiService.sendPlatfromRequest(data);
return ApiService.sendPlatformRequest(data);
}

static async setCollectionAttribute(setCollectionAttributeData: Record<string, unknown>) {
Expand All @@ -121,7 +121,7 @@ export class CollectionApi {
},
};

return ApiService.sendPlatfromRequest(data);
return ApiService.sendPlatformRequest(data);
}

static async removeCollectionAttribute(removeCollectionAttributeData: Record<string, unknown>) {
Expand All @@ -135,7 +135,7 @@ export class CollectionApi {
},
};

return ApiService.sendPlatfromRequest(data);
return ApiService.sendPlatformRequest(data);
}

static async removeAllAttributes(removeAllAttributesData: Record<string, unknown>) {
Expand All @@ -150,6 +150,6 @@ export class CollectionApi {
},
};

return ApiService.sendPlatfromRequest(data);
return ApiService.sendPlatformRequest(data);
}
}
2 changes: 1 addition & 1 deletion resources/js/api/fueltank.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import queries from './queries';

export class FuelTankApi {
static async sendPlatfromRequest(data: Record<string, unknown>) {
return ApiService.sendPlatfromRequest(data, '/fuel-tanks');
return ApiService.sendPlatformRequest(data, '/fuel-tanks');
}

static async getFuelTank(name: string, tankId: string) {
Expand Down
17 changes: 11 additions & 6 deletions resources/js/api/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ export class ApiService {
return resp.json();
}

static async sendPlatfromRequest(data: Record<string, unknown>, schema: string = ''): Promise<any> {
static async sendPlatformRequest(data: Record<string, unknown>, schema: string = ''): Promise<any> {
const appStore = useAppStore();

return new Promise((resolve, reject) => {
Expand All @@ -75,18 +75,23 @@ export class ApiService {
message: error[key][0],
};
});
console.log('rejected errors');
reject(errors);
} else {
console.log('rejected');
reject({ field: 'Error', message });
}
} else {
console.log('resolved');
resolve(res);
}
})
.catch((err) => {
console.log('catch 1');
throw err;
});
}).catch((err) => {
console.log('catch 2');
throw err;
});
}
Expand Down Expand Up @@ -114,7 +119,7 @@ export class ApiService {
},
};

return ApiService.sendPlatfromRequest(data);
return ApiService.sendPlatformRequest(data);
}

static async thaw(thawData: Record<string, unknown>) {
Expand All @@ -131,7 +136,7 @@ export class ApiService {
},
};

return ApiService.sendPlatfromRequest(data);
return ApiService.sendPlatformRequest(data);
}

static async batchMint(batchMintData: Record<string, unknown>) {
Expand All @@ -148,7 +153,7 @@ export class ApiService {
},
};

return ApiService.sendPlatfromRequest(data);
return ApiService.sendPlatformRequest(data);
}

static async batchTransfer(batchTransferData: Record<string, unknown>) {
Expand All @@ -165,7 +170,7 @@ export class ApiService {
}),
},
};
return ApiService.sendPlatfromRequest(data);
return ApiService.sendPlatformRequest(data);
}

static async batchSetAttribute(batchSetAttributeData: Record<string, unknown>) {
Expand All @@ -180,6 +185,6 @@ export class ApiService {
},
};

return ApiService.sendPlatfromRequest(data);
return ApiService.sendPlatformRequest(data);
}
}
2 changes: 1 addition & 1 deletion resources/js/api/marketplace.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import queries from './queries';

export class MarketplaceApi {
static async sendPlatfromRequest(data: Record<string, unknown>) {
return ApiService.sendPlatfromRequest(data, '/marketplace');
return ApiService.sendPlatformRequest(data, '/marketplace');
}

static async getListings(getListingsData: Record<string, unknown>) {
Expand Down
22 changes: 11 additions & 11 deletions resources/js/api/token.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export class TokenApi {
},
};

return ApiService.sendPlatfromRequest(data);
return ApiService.sendPlatformRequest(data);
}

static async approveToken(tokenData: Record<string, unknown>) {
Expand All @@ -33,7 +33,7 @@ export class TokenApi {
},
};

return ApiService.sendPlatfromRequest(data);
return ApiService.sendPlatformRequest(data);
}

static async unapproveToken(tokenData: Record<string, unknown>) {
Expand All @@ -48,7 +48,7 @@ export class TokenApi {
},
};

return ApiService.sendPlatfromRequest(data);
return ApiService.sendPlatformRequest(data);
}

static async burnToken(tokenData: Record<string, unknown>) {
Expand All @@ -67,7 +67,7 @@ export class TokenApi {
},
};

return ApiService.sendPlatfromRequest(data);
return ApiService.sendPlatformRequest(data);
}

static async mutateToken(tokenData: Record<string, unknown>) {
Expand All @@ -88,7 +88,7 @@ export class TokenApi {
},
};

return ApiService.sendPlatfromRequest(data);
return ApiService.sendPlatformRequest(data);
}

static async transferToken(tokenData: Record<string, unknown>) {
Expand All @@ -112,7 +112,7 @@ export class TokenApi {
},
};

return ApiService.sendPlatfromRequest(data);
return ApiService.sendPlatformRequest(data);
}

static async createToken(tokenData: Record<string, unknown>) {
Expand All @@ -127,7 +127,7 @@ export class TokenApi {
},
};

return ApiService.sendPlatfromRequest(data);
return ApiService.sendPlatformRequest(data);
}

static async mintToken(tokenData: Record<string, unknown>) {
Expand All @@ -142,7 +142,7 @@ export class TokenApi {
},
};

return ApiService.sendPlatfromRequest(data);
return ApiService.sendPlatformRequest(data);
}

static async setTokenAttribute(setTokenAttributeData: Record<string, unknown>) {
Expand All @@ -158,7 +158,7 @@ export class TokenApi {
},
};

return ApiService.sendPlatfromRequest(data);
return ApiService.sendPlatformRequest(data);
}

static async removeTokenAttribute(removeTokenAttributeData: Record<string, unknown>) {
Expand All @@ -173,7 +173,7 @@ export class TokenApi {
},
};

return ApiService.sendPlatfromRequest(data);
return ApiService.sendPlatformRequest(data);
}

static async removeAllAttributes(removeAllAttributesData: Record<string, unknown>) {
Expand All @@ -188,6 +188,6 @@ export class TokenApi {
},
};

return ApiService.sendPlatfromRequest(data);
return ApiService.sendPlatformRequest(data);
}
}
10 changes: 5 additions & 5 deletions resources/js/api/transaction.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export class TransactionApi {
},
};

return ApiService.sendPlatfromRequest(data);
return ApiService.sendPlatformRequest(data);
}

static async getTransactions(getTransactionsData: Record<string, unknown>) {
Expand All @@ -31,7 +31,7 @@ export class TransactionApi {
},
};

return ApiService.sendPlatfromRequest(data);
return ApiService.sendPlatformRequest(data);
}

static async getWallet(walletData: Record<string, unknown>) {
Expand All @@ -45,7 +45,7 @@ export class TransactionApi {
},
};

return ApiService.sendPlatfromRequest(data);
return ApiService.sendPlatformRequest(data);
}

static async retryTransactions(retryTransactionsData: Record<string, unknown>) {
Expand All @@ -57,7 +57,7 @@ export class TransactionApi {
},
};

return ApiService.sendPlatfromRequest(data);
return ApiService.sendPlatformRequest(data);
}

static async updateTransaction(updateTransactionData: Record<string, unknown>) {
Expand All @@ -73,6 +73,6 @@ export class TransactionApi {
},
};

return ApiService.sendPlatfromRequest(data);
return ApiService.sendPlatformRequest(data);
}
}

0 comments on commit c44d865

Please sign in to comment.