"use strict"; angular.module("vocabulary") .service("wordApi", ["createApi", function (createApi) { var api = createApi("/api/words"); function getWordsForSearch(searchText) { return api.get('/search?text=' + searchText); } function generateWordWorkTypes(wordList) { return api.post('/word-work-types', wordList); } function getWordsForTopic(topicId) { return api.get("?topicId=" + topicId); } function getWordsForTopicByLetter(topicId, letter) { return api.get("?topicId=" + topicId + "&letterSelector=" + letter); } function getBatchEnteredWords(wordList){ return api.post('/batchWords', wordList); } return { getWordsForSearch: getWordsForSearch, generateWordWorkTypes: generateWordWorkTypes, getWordsForTopic: getWordsForTopic, getWordsForTopicByLetter: getWordsForTopicByLetter, getBatchEnteredWords: getBatchEnteredWords }; }]);