Skip to content

Commit cc295af

Browse files
authored
Merge pull request #981 from numbersprotocol/feature-upgrade-api-to-v3
change(dia-backend): upgrade all APIs to v3
2 parents 6626c34 + 54f8da2 commit cc295af

File tree

6 files changed

+20
-21
lines changed

6 files changed

+20
-21
lines changed

src/app/shared/dia-backend/asset/dia-backend-asset-repository.service.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ export class DiaBackendAssetRepository {
182182
}
183183

184184
return this.httpClient.get<PaginatedResponse<DiaBackendAsset>>(
185-
`${BASE_URL}/api/v2/assets/`,
185+
`${BASE_URL}/api/v3/assets/`,
186186
{ headers, params }
187187
);
188188
})
@@ -193,7 +193,7 @@ export class DiaBackendAssetRepository {
193193
return defer(() => this.authService.getAuthHeaders()).pipe(
194194
concatMap(headers =>
195195
this.httpClient.get<DiaBackendAsset>(
196-
`${BASE_URL}/api/v2/assets/${id}/`,
196+
`${BASE_URL}/api/v3/assets/${id}/`,
197197
{ headers }
198198
)
199199
)
@@ -206,7 +206,7 @@ export class DiaBackendAssetRepository {
206206
return defer(() => this.authService.getAuthHeaders()).pipe(
207207
concatMap(headers =>
208208
this.httpClient.post(
209-
`${BASE_URL}/api/v2/assets/${id}/download/`,
209+
`${BASE_URL}/api/v3/assets/${id}/download/`,
210210
formData,
211211
{ headers, responseType: 'blob' }
212212
)
@@ -236,7 +236,7 @@ export class DiaBackendAssetRepository {
236236
]).pipe(
237237
concatMap(([headers, formData]) =>
238238
this.httpClient.patch<UpdateAssetResponse>(
239-
`${BASE_URL}/api/v2/assets/${proof.diaBackendAssetId}/`,
239+
`${BASE_URL}/api/v3/assets/${proof.diaBackendAssetId}/`,
240240
formData,
241241
{ headers }
242242
)
@@ -251,7 +251,7 @@ export class DiaBackendAssetRepository {
251251
return defer(() => this.authService.getAuthHeaders()).pipe(
252252
concatMap(headers =>
253253
this.httpClient.delete<DeleteAssetResponse>(
254-
`${BASE_URL}/api/v2/assets/${id}/`,
254+
`${BASE_URL}/api/v3/assets/${id}/`,
255255
{ headers }
256256
)
257257
),
@@ -273,7 +273,7 @@ export class DiaBackendAssetRepository {
273273
return defer(() => this.authService.getAuthHeadersWithApiKey()).pipe(
274274
concatMap(headers => {
275275
return this.httpClient.post(
276-
`${BASE_URL}/api/v2/assets/${id}/mint/`,
276+
`${BASE_URL}/api/v3/assets/${id}/mint/`,
277277
formData,
278278
{ headers }
279279
);

src/app/shared/dia-backend/asset/uploading/dia-backend-asset-uploading.service.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -130,8 +130,7 @@ export class DiaBackendAssetUploadingService {
130130
return throwError(err);
131131
}),
132132
map(diaBackendAsset => {
133-
// NOTE: need to change to diaBackendAsset.id when migrate to v3
134-
proof.diaBackendAssetId = diaBackendAsset.uuid;
133+
proof.diaBackendAssetId = diaBackendAsset.id;
135134
return proof;
136135
}),
137136
retryWhen(err$ =>

src/app/shared/dia-backend/contact/dia-backend-contact-repository.service.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ export class DiaBackendContactRepository {
6161
return defer(() => this.authService.getAuthHeaders()).pipe(
6262
concatMap(headers =>
6363
this.httpClient.post<ContactDeleteResponse>(
64-
`${BASE_URL}/api/v2/contacts/delete/`,
64+
`${BASE_URL}/api/v3/contacts/delete/`,
6565
{ email },
6666
{ headers }
6767
)
@@ -95,7 +95,7 @@ export class DiaBackendContactRepository {
9595
}
9696

9797
return this.httpClient.get<PaginatedResponse<DiaBackendContact>>(
98-
`${BASE_URL}/api/v2/contacts/`,
98+
`${BASE_URL}/api/v3/contacts/`,
9999
{ headers, params }
100100
);
101101
}),

src/app/shared/dia-backend/series/dia-backend-series-repository.service.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ export class DiaBackendSeriesRepository {
4646
params = params.set('collected', `${collected}`);
4747
}
4848
return this.httpClient.get<PaginatedResponse<DiaBackendSeries>>(
49-
`${BASE_URL}/api/v2/series/`,
49+
`${BASE_URL}/api/v3/series/`,
5050
{ headers, params }
5151
);
5252
})
@@ -57,7 +57,7 @@ export class DiaBackendSeriesRepository {
5757
return defer(() => this.authService.getAuthHeaders()).pipe(
5858
concatMap(headers =>
5959
this.httpClient.get<DiaBackendSeries>(
60-
`${BASE_URL}/api/v2/series/${id}/`,
60+
`${BASE_URL}/api/v3/series/${id}/`,
6161
{ headers }
6262
)
6363
)

src/app/shared/dia-backend/transaction/dia-backend-transaction-repository.service.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ export class DiaBackendTransactionRepository {
116116
params = params.set('limit', `${limit}`);
117117
}
118118
return this.httpClient.get<PaginatedResponse<DiaBackendTransaction>>(
119-
`${BASE_URL}/api/v2/transactions/inbox/`,
119+
`${BASE_URL}/api/v3/transactions/inbox/`,
120120
{ headers, params }
121121
);
122122
})
@@ -138,7 +138,7 @@ export class DiaBackendTransactionRepository {
138138
}
139139

140140
return this.httpClient.get<PaginatedResponse<DiaBackendTransaction>>(
141-
`${BASE_URL}/api/v2/transactions/`,
141+
`${BASE_URL}/api/v3/transactions/`,
142142
{ headers, params }
143143
);
144144
}),
@@ -150,7 +150,7 @@ export class DiaBackendTransactionRepository {
150150
return defer(() => this.authService.getAuthHeaders()).pipe(
151151
concatMap(headers =>
152152
this.httpClient.get<DiaBackendTransaction>(
153-
`${BASE_URL}/api/v2/transactions/${id}/`,
153+
`${BASE_URL}/api/v3/transactions/${id}/`,
154154
{ headers }
155155
)
156156
)
@@ -171,7 +171,7 @@ export class DiaBackendTransactionRepository {
171171
return defer(() => this.authService.getAuthHeaders()).pipe(
172172
concatMap(headers =>
173173
this.httpClient.post<CreateTransactionResponse>(
174-
`${BASE_URL}/api/v2/transactions/`,
174+
`${BASE_URL}/api/v3/transactions/`,
175175
{
176176
asset_id: assetId,
177177
email: targetEmail,
@@ -197,7 +197,7 @@ export class DiaBackendTransactionRepository {
197197
return defer(() => this.authService.getAuthHeaders()).pipe(
198198
concatMap(headers =>
199199
this.httpClient.post<AcceptTransactionResponse>(
200-
`${BASE_URL}/api/v2/transactions/${id}/accept/`,
200+
`${BASE_URL}/api/v3/transactions/${id}/accept/`,
201201
{},
202202
{ headers }
203203
)
@@ -214,7 +214,7 @@ export class DiaBackendTransactionRepository {
214214
return defer(() => this.authService.getAuthHeaders()).pipe(
215215
concatMap(headers =>
216216
this.httpClient.post<AcceptTransactionResponse>(
217-
`${BASE_URL}/api/v2/transactions/${id}/ignore/`,
217+
`${BASE_URL}/api/v3/transactions/${id}/ignore/`,
218218
{},
219219
{ headers }
220220
)

src/app/shared/dia-backend/wallet/dia-backend-wallet.service.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ export class DiaBackendWalletService {
3030
return defer(() => this.authService.getAuthHeaders()).pipe(
3131
concatMap(headers => {
3232
return this.httpClient.get<DiaBackendWallet>(
33-
`${BASE_URL}/api/v2/wallets/asset-wallet/`,
33+
`${BASE_URL}/api/v3/wallets/asset-wallet/`,
3434
{ headers }
3535
);
3636
})
@@ -43,7 +43,7 @@ export class DiaBackendWalletService {
4343
const formData = new FormData();
4444
formData.set('private_key', privateKey);
4545
return this.httpClient.post<DiaBackendWallet>(
46-
`${BASE_URL}/api/v2/wallets/asset-wallet/`,
46+
`${BASE_URL}/api/v3/wallets/asset-wallet/`,
4747
formData,
4848
{ headers }
4949
);
@@ -55,7 +55,7 @@ export class DiaBackendWalletService {
5555
return defer(() => this.authService.getAuthHeaders()).pipe(
5656
concatMap(headers => {
5757
return this.httpClient.get<DiaBackendWallet>(
58-
`${BASE_URL}/api/v2/wallets/managed-wallet/`,
58+
`${BASE_URL}/api/v3/wallets/managed-wallet/`,
5959
{ headers }
6060
);
6161
})

0 commit comments

Comments
 (0)