fix offer id

This commit is contained in:
boufni95 2024-12-06 17:43:08 +00:00
parent 9dd77fe0bf
commit 72b073d982
2 changed files with 3 additions and 3 deletions

View file

@ -90,7 +90,7 @@ export class OfferManager {
} }
async UpdateUserOffer(ctx: Types.UserContext, req: Types.OfferConfig) { async UpdateUserOffer(ctx: Types.UserContext, req: Types.OfferConfig) {
await this.storage.offerStorage.UpdateUserOffer(ctx.app_user_id, { await this.storage.offerStorage.UpdateUserOffer(ctx.app_user_id, req.offer_id, {
expected_data: req.expected_data, expected_data: req.expected_data,
label: req.label, label: req.label,
price_sats: req.price_sats, price_sats: req.price_sats,

View file

@ -33,8 +33,8 @@ export default class {
async DeleteUserOffer(appUserId: string, offerId: string, entityManager = this.DB) { async DeleteUserOffer(appUserId: string, offerId: string, entityManager = this.DB) {
await entityManager.getRepository(UserOffer).delete({ app_user_id: appUserId, offer_id: offerId }) await entityManager.getRepository(UserOffer).delete({ app_user_id: appUserId, offer_id: offerId })
} }
async UpdateUserOffer(app_user_id: string, req: Partial<UserOffer>) { async UpdateUserOffer(app_user_id: string, offerId: string, req: Partial<UserOffer>) {
return this.DB.getRepository(UserOffer).update({ app_user_id, offer_id: req.offer_id }, req) return this.DB.getRepository(UserOffer).update({ app_user_id, offer_id: offerId }, req)
} }
async GetUserOffers(app_user_id: string): Promise<UserOffer[]> { async GetUserOffers(app_user_id: string): Promise<UserOffer[]> {