From 5f914617998c6e37b3fa96d974c79a76b0c79827 Mon Sep 17 00:00:00 2001 From: counterweight Date: Tue, 25 Feb 2025 14:01:25 +0100 Subject: [PATCH] start stitching --- src/models/offerDetailsSet.js | 6 +----- src/public/javascript/offers.js | 21 +++++++++++++++++++++ src/views/offers.ejs | 2 +- 3 files changed, 23 insertions(+), 6 deletions(-) diff --git a/src/models/offerDetailsSet.js b/src/models/offerDetailsSet.js index 04e0cac..2c34018 100644 --- a/src/models/offerDetailsSet.js +++ b/src/models/offerDetailsSet.js @@ -22,11 +22,7 @@ const OfferDetailsSet = sequelize.define( type: DataTypes.NUMBER, allowNull: false, }, - min_trade_amount_eur: { - type: DataTypes.NUMBER, - allowNull: false, - }, - max_trade_amount_eur: { + trade_amount_eur: { type: DataTypes.NUMBER, allowNull: false, }, diff --git a/src/public/javascript/offers.js b/src/public/javascript/offers.js index eaa49cc..0edcb0d 100644 --- a/src/public/javascript/offers.js +++ b/src/public/javascript/offers.js @@ -101,6 +101,23 @@ function validateBitcoinMethodCheckboxes(clickedCheckbox) { } } +function publishOffer() { + // read info from all elements + // compose a json + // hit the endpoint + + const offerDetails = { + wants: 'BTC', + premium: '0', + trade_amount_eur: '100', + location_details: 'this and there', + time_availability_details: 'then and then', + is_onchain_accepted: true, + is_lightning_accepted: true, + are_big_notes_accepted: + }; +} + buttonStartCreateOffer.addEventListener('click', () => { toggleCreateOfferControls(); }); @@ -139,4 +156,8 @@ for (const btcMethodCheckbox of btcMethodCheckboxes) { }); } +publishOfferButton.addEventListener('click', () => { + publishOffer(); +}); + updateBtcInput(); diff --git a/src/views/offers.ejs b/src/views/offers.ejs index ffa747d..8dad674 100644 --- a/src/views/offers.ejs +++ b/src/views/offers.ejs @@ -58,7 +58,7 @@ Tu precio: 90 000€/BTC

-

(Precio mercado: 83 000€/BTC)

+

(Precio mercado: 83 000€/BTC)