mirror of
https://github.com/openmhz/trunk-server.git
synced 2026-11-14 01:37:48 -05:00
very simple get calls
This commit is contained in:
@@ -56,13 +56,6 @@ async function get_calls(query, numResults, res) {
|
|||||||
async function build_filter(filter_type, code, start_time, direction, shortName, numResults, starred, res) {
|
async function build_filter(filter_type, code, start_time, direction, shortName, numResults, starred, res) {
|
||||||
var filter = {};
|
var filter = {};
|
||||||
var query = {};
|
var query = {};
|
||||||
var FilterType = {
|
|
||||||
All: 0,
|
|
||||||
Talkgroup: 1,
|
|
||||||
Group: 2,
|
|
||||||
Unit: 3
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
if (start_time) {
|
if (start_time) {
|
||||||
var start = new Date(start_time);
|
var start = new Date(start_time);
|
||||||
@@ -77,10 +70,6 @@ async function build_filter(filter_type, code, start_time, direction, shortName,
|
|||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
/*
|
|
||||||
filter.len = {
|
|
||||||
$gte: -1.0
|
|
||||||
};*/
|
|
||||||
|
|
||||||
|
|
||||||
var sort_order = {};
|
var sort_order = {};
|
||||||
@@ -96,7 +85,10 @@ async function build_filter(filter_type, code, start_time, direction, shortName,
|
|||||||
query['direction'] = direction;
|
query['direction'] = direction;
|
||||||
query['sort_order'] = sort_order;
|
query['sort_order'] = sort_order;
|
||||||
|
|
||||||
if (filter_type) {
|
query['filter'] = filter;
|
||||||
|
get_calls(query, numResults, res);
|
||||||
|
|
||||||
|
/* if (filter_type) {
|
||||||
if ((filter_type == "group") && code && (code.indexOf(',') == -1)) {
|
if ((filter_type == "group") && code && (code.indexOf(',') == -1)) {
|
||||||
let o_id
|
let o_id
|
||||||
try {
|
try {
|
||||||
@@ -140,16 +132,6 @@ async function build_filter(filter_type, code, start_time, direction, shortName,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (filter_type == "unit") {
|
|
||||||
if (code) {
|
|
||||||
var codeArray = code.split(',').map(function (item) {
|
|
||||||
return parseInt(item, 10);
|
|
||||||
});
|
|
||||||
filter.srcListv = {
|
|
||||||
$in: codeArray
|
|
||||||
};
|
|
||||||
}
|
|
||||||
}
|
|
||||||
query['filter'] = filter;
|
query['filter'] = filter;
|
||||||
|
|
||||||
get_calls(query, numResults, res);
|
get_calls(query, numResults, res);
|
||||||
@@ -157,7 +139,7 @@ async function build_filter(filter_type, code, start_time, direction, shortName,
|
|||||||
} else {
|
} else {
|
||||||
query['filter'] = filter;
|
query['filter'] = filter;
|
||||||
get_calls(query, numResults, res);
|
get_calls(query, numResults, res);
|
||||||
}
|
}*/
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -96,7 +96,6 @@ function addSystemClients(req, res, next) {
|
|||||||
|
|
||||||
|
|
||||||
/*------ CALLS ----------*/
|
/*------ CALLS ----------*/
|
||||||
|
|
||||||
app.get('/card/:id', calls.get_card);
|
app.get('/card/:id', calls.get_card);
|
||||||
app.post('/add_star/:id', calls.add_star);
|
app.post('/add_star/:id', calls.add_star);
|
||||||
app.post('/remove_star/:id', calls.remove_star);
|
app.post('/remove_star/:id', calls.remove_star);
|
||||||
|
|||||||
Reference in New Issue
Block a user