some experiments around therems, a request to update asset
This commit is contained in:
parent
374551d2bb
commit
aa815a5bd7
14 changed files with 229 additions and 59 deletions
|
@ -12,6 +12,7 @@ set(HEADERS
|
|||
currencies.h
|
||||
addasset.h
|
||||
deleteasset.h
|
||||
updateasset.h
|
||||
)
|
||||
|
||||
set(SOURCES
|
||||
|
@ -25,6 +26,7 @@ set(SOURCES
|
|||
currencies.cpp
|
||||
addasset.cpp
|
||||
deleteasset.cpp
|
||||
updateasset.cpp
|
||||
)
|
||||
|
||||
target_sources(magpie PRIVATE ${SOURCES})
|
||||
|
|
|
@ -15,11 +15,11 @@ class AddAsset : public Post {
|
|||
|
||||
public:
|
||||
AddAsset (
|
||||
const QString& title,
|
||||
const QString& icon,
|
||||
const QColor& color,
|
||||
Models::Currency::ID currency,
|
||||
const QUrl& baseUrl
|
||||
const QString& title,
|
||||
const QString& icon,
|
||||
const QColor& color,
|
||||
Models::Currency::ID currency,
|
||||
const QUrl& baseUrl
|
||||
);
|
||||
};
|
||||
|
||||
|
|
19
API/requests/updateasset.cpp
Normal file
19
API/requests/updateasset.cpp
Normal file
|
@ -0,0 +1,19 @@
|
|||
//SPDX-FileCopyrightText: 2023 Yury Gubich <blue@macaw.me>
|
||||
//SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
#include "updateasset.h"
|
||||
|
||||
Request::UpdateAsset::UpdateAsset (
|
||||
Models::Asset::ID id,
|
||||
const QString& title,
|
||||
const QString& icon,
|
||||
const QColor& color,
|
||||
Models::Currency::ID currency,
|
||||
const QUrl& baseUrl
|
||||
):
|
||||
Post(createUrl(baseUrl, "/updateAsset"), {
|
||||
{"id", std::to_string(id).c_str()}, {"title", title}, {"icon", icon}, {"currency", std::to_string(currency).c_str()}, {"color", std::to_string(color.rgba()).c_str()}
|
||||
})
|
||||
{
|
||||
emptyResult = true;
|
||||
}
|
27
API/requests/updateasset.h
Normal file
27
API/requests/updateasset.h
Normal file
|
@ -0,0 +1,27 @@
|
|||
// SPDX-FileCopyrightText: 2023 Yury Gubich <blue@macaw.me>
|
||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <QColor>
|
||||
|
||||
#include "post.h"
|
||||
#include "models/assets.h"
|
||||
#include "models/currencies.h"
|
||||
|
||||
namespace Request {
|
||||
|
||||
class UpdateAsset : public Post {
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
UpdateAsset(
|
||||
Models::Asset::ID id,
|
||||
const QString& title,
|
||||
const QString& icon,
|
||||
const QColor& color,
|
||||
Models::Currency::ID currency,
|
||||
const QUrl& baseUrl
|
||||
);
|
||||
};
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue