Skip to content

Commit 5e1045b

Browse files
committed
Merge pull request #355 from apinf/feature/bookmark-inte
Feature/bookmark inte
2 parents 8f0591a + 7b96401 commit 5e1045b

File tree

2 files changed

+20
-0
lines changed

2 files changed

+20
-0
lines changed

client/views/catalogue/catalogue.html

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@ <h3 class="box-title">Available APIs</h3>
77
<div id="example2_wrapper" class="dataTables_wrapper form-inline dt-bootstrap">
88
{{> tabular table=TabularTables.ApiTable class="table table-striped table-bordered table-condensed"}}
99
</div>
10+
{{#if userHasBookmarks}}
11+
{{>bookmarks}}
12+
{{/if}}
1013
</div>
1114
</div>
1215
</template>
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
Template.catalogue.helpers({
2+
userHasBookmarks: function () {
3+
// Get current user bookmark (should be only one API Bookmarks result available)
4+
var userBookmarks = ApiBookmarks.findOne();
5+
6+
// get array of API IDs
7+
var apiIds = userBookmarks.apiIds;
8+
console.log(apiIds);
9+
10+
// Check if user has bookmarked apis
11+
if(apiIds.length > 0) {
12+
return true;
13+
} else {
14+
return false;
15+
}
16+
}
17+
});

0 commit comments

Comments
 (0)