Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/lib/bridge/handlers/fetch_inspect_info.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ export interface FetchInspectInfoResponse {
export const FetchInspectInfo = new SimpleHandler<FetchInspectInfoRequest, FetchInspectInfoResponse>(
RequestType.FETCH_INSPECT_INFO,
(req) => {
const apiUrl = `https://api.csgofloat.com/?url=${req.link}&minimal=true${
const apiUrl = `https://api.csfloat.com/?url=${req.link}&minimal=true${
req.listPrice ? '&listPrice=' + req.listPrice : ''
}`;
return fetch(apiUrl).then((resp) => {
Expand Down
26 changes: 22 additions & 4 deletions src/lib/bridge/handlers/fetch_pending_trades.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,28 @@ export interface FetchPendingTradesResponse {
export const FetchPendingTrades = new SimpleHandler<FetchPendingTradesRequest, FetchPendingTradesResponse>(
RequestType.FETCH_PENDING_TRADES,
async (req) => {
return fetch(`https://csgofloat.com/api/v1/me/pending-trades`, {
credentials: 'include',
}).then((resp) => {
try {
const resp = await fetch(`https://csfloat.com/api/v1/me/pending-trades`, {
credentials: 'include',
});

if (resp.status !== 200) {
throw new Error('invalid status');
}

return resp.json() as Promise<FetchPendingTradesResponse>;
});
} catch (e) {
// Try the old CSGOFloat URL (in case they have an old session from there)
// Of note, this can be removed ~1 week after the migration.
const resp = await fetch(`https://csgofloat.com/api/v1/me/pending-trades`, {
credentials: 'include',
});

if (resp.status !== 200) {
throw new Error('invalid status');
}

return resp.json();
}
}
);
2 changes: 1 addition & 1 deletion src/lib/bridge/handlers/fetch_stall.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export interface FetchStallResponseError {
export const FetchStall = new SimpleHandler<FetchStallRequest, FetchStallResponse>(
RequestType.FETCH_STALL,
async (req) => {
return fetch(`https://csgofloat.com/api/v1/users/${req.steam_id64}/stall`).then((resp) => {
return fetch(`https://csfloat.com/api/v1/users/${req.steam_id64}/stall`).then((resp) => {
return resp.json().then((json: FetchStallResponse | FetchStallResponseError) => {
if (resp.ok) {
return json;
Expand Down