changed get request to post
This commit is contained in:
@@ -34,8 +34,8 @@ var errorCode = new ErrorCode();
|
||||
* return : CategoryResponse
|
||||
*/
|
||||
exports.listCategories = function (req, res) {
|
||||
var from = req.query.from;
|
||||
var count = req.query.count;
|
||||
var from = req.body.from;
|
||||
var count = req.body.count;
|
||||
|
||||
var categoryResponse = new CategoryResponse();
|
||||
internalLogic.listCategoriesWorkUnit(from, count, function (listCategoriesErr, categories) {
|
||||
@@ -54,9 +54,9 @@ exports.listCategories = function (req, res) {
|
||||
* return : BrandResponse
|
||||
*/
|
||||
exports.listBrands = function (req, res) {
|
||||
var categoryID = req.query.category_id;
|
||||
var from = req.query.from;
|
||||
var count = req.query.count;
|
||||
var categoryID = req.body.category_id;
|
||||
var from = req.body.from;
|
||||
var count = req.body.count;
|
||||
|
||||
var brandResponse = new BrandResponse();
|
||||
internalLogic.listBrandsWorkUnit(categoryID, from, count, function (listBrandsErr, brands) {
|
||||
@@ -91,8 +91,8 @@ exports.listUnpublishedBrands = function (req, res) {
|
||||
* return : ProtocolResponse
|
||||
*/
|
||||
exports.listIRProtocols = function (req, res) {
|
||||
var from = req.query.from;
|
||||
var count = req.query.count;
|
||||
var from = req.body.from;
|
||||
var count = req.body.count;
|
||||
|
||||
var protocolResponse = new ProtocolResponse();
|
||||
internalLogic.listIRProtocolsWorkUnit(from, count, function (listProtocolsErr, protocols) {
|
||||
@@ -124,7 +124,7 @@ exports.listProvinces = function (req, res) {
|
||||
* return : CityResponse
|
||||
*/
|
||||
exports.listCities = function (req, res) {
|
||||
var provincePrefix = req.query.province_prefix;
|
||||
var provincePrefix = req.body.province_prefix;
|
||||
|
||||
var cityResponse = new CityResponse();
|
||||
internalLogic.listCitiesWorkUnit(provincePrefix, function (listCitiesErr, cities) {
|
||||
@@ -141,8 +141,8 @@ exports.listCities = function (req, res) {
|
||||
* return : CityResponse
|
||||
*/
|
||||
exports.listCoveredCities = function (req, res) {
|
||||
var from = req.query.from;
|
||||
var count = req.query.count;
|
||||
var from = req.body.from;
|
||||
var count = req.body.count;
|
||||
|
||||
var cityResponse = new CityResponse();
|
||||
internalLogic.listCoveredCitiesWorkUnit(from, count, function (listCitiesErr, cities) {
|
||||
@@ -159,9 +159,9 @@ exports.listCoveredCities = function (req, res) {
|
||||
* return : OperatorResponse
|
||||
*/
|
||||
exports.listOperators = function (req, res) {
|
||||
var cityCode = req.query.city_code;
|
||||
var from = req.query.from;
|
||||
var count = req.query.count;
|
||||
var cityCode = req.body.city_code;
|
||||
var from = req.body.from;
|
||||
var count = req.body.count;
|
||||
|
||||
var operatorResponse = new OperatorResponse();
|
||||
internalLogic.listOperatorsWorkUnit(cityCode, from, count, function (listOperatorsErr, operators) {
|
||||
@@ -189,8 +189,6 @@ exports.listRemoteIndexes = function (req, res) {
|
||||
|
||||
internalLogic.listRemoteIndexesWorkUnit(categoryID, brandID, cityCode, from, count,
|
||||
function (listRemoteIndexesErr, remoteIndexes) {
|
||||
// remoteIndexResponse.status = listRemoteIndexesErr;
|
||||
//remoteIndexResponse = remoteIndexes;
|
||||
res.send(remoteIndexes);
|
||||
res.end();
|
||||
});
|
||||
@@ -204,9 +202,9 @@ exports.listRemoteIndexes = function (req, res) {
|
||||
* return : Remote Index List
|
||||
*/
|
||||
exports.searchRemoteIndexes = function (req, res) {
|
||||
var remoteMap = req.query.remote_map;
|
||||
var from = req.query.from;
|
||||
var count = req.query.count;
|
||||
var remoteMap = req.body.remote_map;
|
||||
var from = req.body.from;
|
||||
var count = req.body.count;
|
||||
|
||||
internalLogic.searchRemoteIndexesWorkUnit(remoteMap, from, count,
|
||||
function (listRemoteIndexesErr, remoteIndexes) {
|
||||
@@ -223,7 +221,7 @@ exports.searchRemoteIndexes = function (req, res) {
|
||||
* return : Redirect to binary download
|
||||
*/
|
||||
exports.downloadRemoteIndex = function (req, res) {
|
||||
var remoteIndexID = req.query.remote_index_id;
|
||||
var remoteIndexID = req.body.remote_index_id;
|
||||
|
||||
internalLogic.downloadRemoteBinCachedWorkUnit(remoteIndexID, function (serveBinErr, filePath) {
|
||||
if (errorCode.SUCCESS.code == serveBinErr.code) {
|
||||
@@ -268,7 +266,7 @@ exports.createRemoteIndex = function (req, res) {
|
||||
var filePath;
|
||||
var contentType;
|
||||
|
||||
var adminID = req.query.id;
|
||||
var adminID = req.body.id;
|
||||
|
||||
form.on('file', function(field, file) {
|
||||
// rename the incoming file to the file's name
|
||||
@@ -329,7 +327,7 @@ exports.createRemoteIndex = function (req, res) {
|
||||
*/
|
||||
exports.deleteRemoteIndex = function (req, res) {
|
||||
var remoteIndex = req.body;
|
||||
var adminID = req.query.id;
|
||||
var adminID = req.body.id;
|
||||
|
||||
var serviceResponse = new ServiceResponse();
|
||||
internalLogic.deleteRemoteIndexWorkUnit(remoteIndex, adminID, function (deleteRemoteErr) {
|
||||
@@ -347,8 +345,8 @@ exports.deleteRemoteIndex = function (req, res) {
|
||||
*/
|
||||
exports.verifyRemoteIndex = function (req, res) {
|
||||
var remoteIndex = req.body;
|
||||
var pass = req.query.pass;
|
||||
var adminID = req.query.id;
|
||||
var pass = req.body.pass;
|
||||
var adminID = req.body.id;
|
||||
|
||||
var serviceResponse = new ServiceResponse();
|
||||
internalLogic.verifyRemoteIndexWorkUnit(remoteIndex, pass, adminID, function (verifyRemoteErr) {
|
||||
@@ -365,7 +363,7 @@ exports.verifyRemoteIndex = function (req, res) {
|
||||
*/
|
||||
exports.fallbackRemoteIndex = function (req, res) {
|
||||
var remoteIndex = req.body;
|
||||
var adminID = req.query.id;
|
||||
var adminID = req.body.id;
|
||||
|
||||
var serviceResponse = new ServiceResponse();
|
||||
internalLogic.fallbackRemoteIndexWorkUnit(remoteIndex, adminID, function (fallbackRemoteErr) {
|
||||
@@ -396,7 +394,7 @@ exports.publishRemoteIndex = function (req, res) {
|
||||
*/
|
||||
exports.createBrand = function (req, res) {
|
||||
var brand = req.body;
|
||||
var adminID = req.query.id;
|
||||
var adminID = req.body.id;
|
||||
|
||||
var serviceResponse = new ServiceResponse();
|
||||
internalLogic.createBrandWorkUnit(brand, adminID, function (createBrandErr) {
|
||||
@@ -432,7 +430,7 @@ exports.createProtocol = function (req, res) {
|
||||
var protocol;
|
||||
var filePath;
|
||||
var contentType;
|
||||
var adminID = req.query.id;
|
||||
var adminID = req.body.id;
|
||||
|
||||
form.on('file', function(field, file) {
|
||||
fs.rename(file.path, form.uploadDir + "/" + file.name);
|
||||
|
||||
Reference in New Issue
Block a user