[API][QSO] Adds field "station_profile_id"

This adds the field station_profile_id to the QSO API this is the number thats shown when you are editing a profile.
pull/678/head
Peter Goodhall 2020-10-29 18:10:46 +00:00
rodzic 855c34f955
commit 48679662de
1 zmienionych plików z 13 dodań i 2 usunięć

Wyświetl plik

@ -388,7 +388,11 @@ class API extends CI_Controller {
return $arguments;
}
/*
*
* Function: QSO
* Task: allows passing of ADIF data to Cloudlog
*/
function qso() {
header('Content-type: application/json');
@ -397,12 +401,14 @@ class API extends CI_Controller {
// Decode JSON and store
$obj = json_decode(file_get_contents("php://input"), true);
if(!isset($obj['key']) || $this->api_model->authorize($obj['key']) == 0) {
http_response_code(401);
echo json_encode(['status' => 'failed', 'reason' => "missing api key"]);
die();
}
if($obj['type'] == "adif" && $obj['string'] != "") {
// Load the logbook model for adding QSO records
$this->load->model('logbook_model');
@ -420,8 +426,13 @@ class API extends CI_Controller {
{
break;
};
$this->logbook_model->import($record, 0, NULL, NULL, NULL);
if(isset($obj['station_profile_id'])) {
$this->logbook_model->import($record, $obj['station_profile_id'], NULL, NULL, NULL);
} else {
$this->logbook_model->import($record, 0, NULL, NULL, NULL);
}
};
http_response_code(201);