Skip to content

Commit

Permalink
.
Browse files Browse the repository at this point in the history
  • Loading branch information
mo9a7i committed May 27, 2023
1 parent b4853ca commit aafa0ee
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 3 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# swarmapp-api

## 2.7.7

### Patch Changes

- Fixing prefix of error logging

## 2.7.6

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "swarmapp-api",
"version": "2.7.6",
"version": "2.7.7",
"description": "A javascript wrapper for swarmapp (foursquare) API",
"main": "dist/index.js",
"module": "dist/index.mjs",
Expand Down
7 changes: 7 additions & 0 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,13 @@ Let's say you want to retrieve the list of check-ins for a particular user on Sw

I will be glad ♥ (for the time-being) to add the feature you are missing, just open an issue.

## Updates

- `pnpm changeset`
- `pnpm changeset version`
- commit
- push

## Contributing

We welcome contributions from the community! To contribute to the SwarmApp API, follow these steps:
Expand Down
5 changes: 3 additions & 2 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -439,7 +439,7 @@ class SwarmappApi {
const recent = await this.getRecent(limit);

for(const checkin of recent){
// this.log(`Checkin ${checkin.id} liked before = ${checkin.like}`);

if(checkin.like == false) {
const liked_result = await this.likeCheckin(checkin.id);
this.log(`liked ${checkin.id}`);
Expand Down Expand Up @@ -477,8 +477,9 @@ class SwarmappApi {

error(error: any){
let _prefix = `${new Date().toLocaleString()} - `;
_prefix += typeof this?.user?.firstName != 'undefined' ? this?.user?.firstName : this?.user?.id
_prefix += typeof this?.user?.firstName != 'undefined' ? this?.user?.firstName : this.config.oauth_token
_prefix += ' - Error: '

switch (error?.meta?.code) {
case 401:
throw new Error(`${_prefix} [${error.meta.errorType}] ${error.meta.errorDetail}`)
Expand Down

0 comments on commit aafa0ee

Please sign in to comment.