Skip to content

Commit

Permalink
Update build files for 7.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
ammuench committed Oct 27, 2021
1 parent a457f32 commit d59ca71
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 12 deletions.
8 changes: 0 additions & 8 deletions dist/demo.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,2 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const index_1 = require("./index");
index_1.getTeamInfo(44504, false)
.then((data) => {
console.log(data);
})
.catch((e) => {
console.log(e);
});
2 changes: 1 addition & 1 deletion dist/helpers/api-paths.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ const pageOffset = (limit, page) => {
if (page === 1) {
return 1;
}
return limit * page;
return limit * (page - 1);
};
exports.apiPaths = {
userDonationUrl(id, limit = 100, page = 1) {
Expand Down
6 changes: 3 additions & 3 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,15 +43,15 @@ exports.getUserInfo = (id) => __awaiter(this, void 0, void 0, function* () {
});
});
});
exports.getUserDonations = (id, limit = 0, page = 1) => __awaiter(this, void 0, void 0, function* () {
exports.getUserDonations = (id, limit = 100, page = 1) => __awaiter(this, void 0, void 0, function* () {
return new Promise((resolve, reject) => {
const url = api_paths_1.apiPaths.userDonationUrl(id, limit, page);
const userDonationsJson = {};
node_fetch_1.default(url)
.then((res) => __awaiter(this, void 0, void 0, function* () {
try {
userDonationsJson.countDonations = res.headers.get('num-records') || 0;
userDonationsJson.countPages = Math.ceil(userDonationsJson.countDonations / 100);
userDonationsJson.countPages = Math.ceil(userDonationsJson.countDonations / limit);
userDonationsJson.donations = yield res.json();
resolve(userDonationsJson);
}
Expand Down Expand Up @@ -108,7 +108,7 @@ exports.getTeamDonations = (id, limit = 100, page = 1) => __awaiter(this, void 0
.then((res) => __awaiter(this, void 0, void 0, function* () {
try {
teamDonationsJson.countDonations = res.headers.get('num-records') || 0;
teamDonationsJson.countPages = Math.ceil(teamDonationsJson.countDonations / 100);
teamDonationsJson.countPages = Math.ceil(teamDonationsJson.countDonations / limit);
teamDonationsJson.donations = yield res.json();
}
catch (e) {
Expand Down

0 comments on commit d59ca71

Please sign in to comment.