diff options
| author | ꦌꦫꦶꦏ꧀ꦦꦿꦧꦮꦑꦩꦭ꧀ <erik@darapsa.co.id> | 2023-05-13 18:17:49 +0800 |
|---|---|---|
| committer | ꦌꦫꦶꦏ꧀ꦦꦿꦧꦮꦑꦩꦭ꧀ <erik@darapsa.co.id> | 2023-05-13 18:17:49 +0800 |
| commit | 5bd00e1499884e8458f58db86a6b92bc96da3e57 (patch) | |
| tree | 03516f2759f44034a864e16e9d6eb82aa40629b9 /ord.cxx | |
| parent | 3fc49f2f2838c69be14bcf60c6cf756825b2bbee (diff) | |
Method for updating quantity
Diffstat (limited to 'ord.cxx')
| -rw-r--r-- | ord.cxx | 20 |
1 files changed, 13 insertions, 7 deletions
@@ -89,8 +89,8 @@ namespace QInterchange { if (this->profile != profile) this->profile = profile; } - void Ord::remove(const QString &name, const QString &orderPage, - const QString &nextPage) + void Ord::update(const QString &name, const int quantity, + const QString &orderPage, const QString &nextPage) { item_name = (char *)malloc(name.size() + 1); strcpy(item_name, name.toLatin1().constData()); @@ -106,16 +106,22 @@ namespace QInterchange { next_page = (char *)malloc(nextPage.size() + 1); strcpy(next_page, nextPage.toLatin1().constData()); } - interchange_ord_remove(item_name, order_page, next_page, - [](interchange_response *response) { + interchange_ord_update(item_name, quantity, order_page, + next_page, [](interchange_response *response) { free(item_name); if (order_page) free(order_page); if (next_page) free(next_page); - ord->emitRemoval(QString{response->data}); + ord->emitUpdate(QString{response->data}); interchange_free_response(response); }); } + void Ord::remove(const QString &name, const QString &orderPage, + const QString &nextPage) + { + update(name, 0, orderPage, nextPage); + } + void Ord::checkout(const Member& member) { order_profile = (char*)malloc(profile.size() + 1); @@ -168,9 +174,9 @@ namespace QInterchange { }); } - void Ord::emitRemoval(const QString &response) + void Ord::emitUpdate(const QString &response) { - emit removed(response); + emit updated(response); } void Ord::emitTransaction(QString const& response) |