Correccion id de subscripcion de alai
This commit is contained in:
@@ -180,7 +180,8 @@ export class SimAlaiUsecases {
|
||||
}
|
||||
|
||||
// TODO: Controlar que no se encuentre la subscription
|
||||
const suspension = this.alaiRepository.pauseSubscription(subscription.data!.id)
|
||||
const subscriptionid = subscription.data?.subscription.id
|
||||
const suspension = this.alaiRepository.pauseSubscription(subscriptionid!)
|
||||
return suspension
|
||||
}, args, args.correlation_id)
|
||||
}
|
||||
@@ -195,9 +196,9 @@ export class SimAlaiUsecases {
|
||||
if (subscription.error != undefined) {
|
||||
return subscription
|
||||
}
|
||||
|
||||
const subscriptionid = subscription.data?.subscription.id
|
||||
// TODO: Controlar que no se encuentre la subscription
|
||||
const suspension = this.alaiRepository.unPauseSubscription(subscription.data!.id)
|
||||
const suspension = this.alaiRepository.unPauseSubscription(subscriptionid!)
|
||||
return suspension
|
||||
}, args, args.correlation_id)
|
||||
}
|
||||
|
||||
@@ -1 +1 @@
|
||||
eyJhbGciOiJIUzM4NCJ9.eyJiciI6InNhdmVmYW1pbHkiLCJpcCI6Ijg4LjE1LjE1Ny4xNjciLCJzdWIiOiJwYWxvbWFpYmFuZXoiLCJzIjoiRVdTMTY0NmFmNjNlZGUyMjgzIiwicG9zIjoic2F2ZWZhbWlseUNhYyIsImlkV3NVc2VyIjoiODYiLCJpc012bmEiOmZhbHNlLCJkb21haW4iOiJBbGFpfHNhdmVmYW1pbHkiLCJpYXQiOjE3Nzc4OTk3MzcsImV4cCI6MTc3NzkxMDUzN30.PvTTRhUpKlslGOerQsLY4RLBXdQ5FIVvUKb_1ZK4b2Zggt04KZhwX0d-XoLAcP93
|
||||
eyJhbGciOiJIUzM4NCJ9.eyJiciI6InNhdmVmYW1pbHkiLCJpcCI6Ijg3LjEyNC4xODIuNjAiLCJzdWIiOiJwYWxvbWFpYmFuZXoiLCJzIjoiRVdTMTY2NDJhMWI5N2E3MmMwIiwicG9zIjoic2F2ZWZhbWlseUNhYyIsImlkV3NVc2VyIjoiODYiLCJpc012bmEiOmZhbHNlLCJkb21haW4iOiJBbGFpfHNhdmVmYW1pbHkiLCJpYXQiOjE3Nzg1OTg3OTgsImV4cCI6MTc3ODYwOTU5OH0.GLUQftXMYiiIy8rdEyfW2MAoyyZCUVbImNXKmZxNovaO0SiBTOHQzgzhov1ajyrf
|
||||
|
||||
@@ -5,13 +5,16 @@ import { httpsAgent } from "./httpsAgent.js"
|
||||
import { DebugTokenManager } from "#aplication/DebugTokenManager.js";
|
||||
|
||||
const tokenManager = new AlaiTokenManager()
|
||||
//const debugTokenManagr = new DebugTokenManager()
|
||||
const debugTokenManagr = new DebugTokenManager()
|
||||
//console.error("USANDO DebugTokenManager! Eliminar en prod")
|
||||
|
||||
|
||||
export const alaiHttp = new HttpClient({
|
||||
baseURL: env.ALAI_API_URL as string,
|
||||
headers: {},
|
||||
jwtManager: tokenManager,
|
||||
headers: {
|
||||
"content-type": "application/json"
|
||||
},
|
||||
//jwtManager: tokenManager,
|
||||
jwtManager: debugTokenManagr,
|
||||
httpsAgent: httpsAgent
|
||||
})
|
||||
|
||||
@@ -139,12 +139,17 @@ export class AlaiRepository {
|
||||
const endpoint = `/v1/subscription/${subscriptionId}`
|
||||
// En teoria ahora se usa ["action", "UNBLOCK"] pero no he probado
|
||||
const params = new URLSearchParams([
|
||||
["action", "CHANGE_STATUS"]
|
||||
["action", "UNBLOCK"]
|
||||
])
|
||||
|
||||
const rawParams = {
|
||||
"action": "UNBLOCK"
|
||||
}
|
||||
|
||||
const data = {
|
||||
status: "ACTIVE"
|
||||
}
|
||||
const promReq = this.httpClient.patch<AlaiAPI.UpdateSubscriptionDTO | undefined>(endpoint, data, { params: params })
|
||||
const promReq = this.httpClient.patch<AlaiAPI.UpdateSubscriptionDTO | undefined>(endpoint, undefined, { params: rawParams })
|
||||
const res = await this.manageRequest(promReq)
|
||||
return res
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user