Skip to content

Commit

Permalink
changed the repository .Data object
Browse files Browse the repository at this point in the history
  • Loading branch information
gokulm committed Aug 19, 2016
1 parent 293462b commit c764142
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 14 deletions.
Binary file added $tf/localversion.tf1
Binary file not shown.
Binary file added $tf/localversion.tfb
Binary file not shown.
Binary file modified $tf/pendingchanges.tf1
Binary file not shown.
Binary file added $tf/pendingchanges.tfb
Binary file not shown.
Binary file added $tf/properties.tf1
Binary file not shown.
29 changes: 15 additions & 14 deletions src/app/services/thirukkurals-repository.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,14 @@
var thirukkuralsRepository = function($http, thirukkuralsUtil){

// todo: should be added to a app constants
var baseUrl = "http://devl-api.gokulnath.com/";
// var baseUrl = "http://devl-api.gokulnath.com/";
var baseUrl = "http://localhost:55130/";

var getThirukkural = function(index){
thirukkuralsUtil.Log("repository: getThirukkural");
return $http.get(baseUrl + "thirukkurals/" + index)
.then(function(response){
return response.data;
return response.data.Data;
});
};

Expand All @@ -21,7 +22,7 @@

return $http.get(url)
.then(function (response) {
return response.data;
return response.data.Data;
});
};

Expand All @@ -31,7 +32,7 @@

return $http.get(url)
.then(function (response) {
return response.data;
return response.data.Data;
});
};

Expand All @@ -41,79 +42,79 @@

return $http.get(url)
.then(function (response) {
return response.data;
return response.data.Data;
});
};

var getThirukkuralsByChapters = function (chapterIndex) {
thirukkuralsUtil.Log("repository: getThirukkuralsByChapters");
return $http.get(baseUrl + "thirukkuralchapters/" + chapterIndex + "/thirukkurals")
.then(function (response) {
return response.data;
return response.data.Data;
});
};

var getThirukkuralsBySections = function (sectionIndex) {
thirukkuralsUtil.Log("repository: getThirukkuralsBySections");
return $http.get(baseUrl + "thirukkuralsections/" + sectionIndex + "/thirukkurals")
.then(function (response) {
return response.data;
return response.data.Data;
});
};

var getThirukkuralsByChapterGroups = function (sectionIndex) {
thirukkuralsUtil.Log("repository: getThirukkuralsByChapterGroups");
return $http.get(baseUrl + "thirukkuralchaptergroups/" + sectionIndex + "/thirukkurals")
.then(function (response) {
return response.data;
return response.data.Data;
});
};

var getThirukkuralChaptersBySection = function (index) {
thirukkuralsUtil.Log("repository: getThirukkuralChaptersBySection");
return $http.get(baseUrl + "thirukkuralsections/" + index + "/chapters")
.then(function (response) {
return response.data;
return response.data.Data;
});
};

var getThirukkuralChaptersByChapterGroup = function (index) {
thirukkuralsUtil.Log("repository: getThirukkuralChaptersByChapterGroup");
return $http.get(baseUrl + "thirukkuralchaptergroups/" + index + "/chapters")
.then(function (response) {
return response.data;
return response.data.Data;
});
};

var searchThirukkuralsInTamil = function (searchText) {
thirukkuralsUtil.Log("repository: searchThirukkuralsInTamil");
return $http.get(baseUrl + "thirukkuralstamilsearch/" + searchText)
.then(function (response) {
return response.data;
return response.data.Data;
});
};

var searchThirukkuralsInEnglish = function (searchText) {
thirukkuralsUtil.Log("repository: searchThirukkuralsInEnglish");
return $http.get(baseUrl + "thirukkuralsenglishsearch/" + searchText)
.then(function (response) {
return response.data;
return response.data.Data;
});
};

function startsWith(searchText) {
thirukkuralsUtil.Log("repository: startsWith");
return $http.get(baseUrl + "thirukkuralsstartswith/" + searchText)
.then(function (response) {
return response.data;
return response.data.Data;
});
};

function endsWith(searchText) {
thirukkuralsUtil.Log("repository: endsWith");
return $http.get(baseUrl + "thirukkuralsendswith/" + searchText)
.then(function (response) {
return response.data;
return response.data.Data;
});
};

Expand Down

0 comments on commit c764142

Please sign in to comment.