Skip to content

Commit d417088

Browse files
committed
Items count
1 parent 3cc717b commit d417088

File tree

2 files changed

+19
-0
lines changed

2 files changed

+19
-0
lines changed

Diff for: BackendlessAPI.cpp

+17
Original file line numberDiff line numberDiff line change
@@ -83,3 +83,20 @@ void BackendlessAPI::loadTableItems(QString tableName, int pageSize, int offset)
8383
}
8484
);
8585
}
86+
87+
void BackendlessAPI::getItemsCount(QString tableName) {
88+
request(
89+
networkAccessManager,
90+
this,
91+
endpoint + appId + "/" + apiKey + "/data/" + tableName + "/count",
92+
{
93+
94+
},
95+
BERequestMethod::get,
96+
[&](auto replyValue){
97+
qDebug() << replyValue;
98+
99+
emit getItemsCountSuccess(replyValue.toInt());
100+
}
101+
);
102+
}

Diff for: BackendlessAPI.hpp

+2
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ class BackendlessAPI: public QObject, public BasicAPI {
3131
void addItemToTable(QString, PostParams);
3232
void deleteItemFromTable(QString, QString);
3333
void loadTableItems(QString tableName, int pageSize = 100, int offset = 0);
34+
void getItemsCount(QString);
3435

3536
signals:
3637
void itemAdded();
@@ -42,6 +43,7 @@ class BackendlessAPI: public QObject, public BasicAPI {
4243
void loadTableItemsSuccess(QString);
4344
void loadTableItemsError(BackendlessError);
4445
#endif
46+
void getItemsCountSuccess(int);
4547

4648
public:
4749
BackendlessUserAPI userAPI;

0 commit comments

Comments
 (0)