1
0
mirror of https://gitlab.crans.org/bde/nk20 synced 2025-06-21 09:58:23 +02:00

Order note research results: match first aliases then normalized names

This commit is contained in:
Yohann D'ANELLO
2020-08-30 22:33:59 +02:00
parent ca7f4791ed
commit a9258c332a
4 changed files with 99 additions and 27 deletions

View File

@ -79,7 +79,7 @@ function refreshBalance () {
* @param fun For each found note with the matched alias `alias`, fun(note, alias) is called.
*/
function getMatchedNotes (pattern, fun) {
$.getJSON("/api/note/alias/?format=json&alias=" + pattern + "&search=user|club&ordering=normalized_name", fun);
$.getJSON("/api/note/alias/?format=json&alias=" + pattern + "&search=user|club", fun);
}
/**
@ -261,9 +261,7 @@ function autoCompleteNote (field_id, note_list_id, notes, notes_display, alias_p
return;
}
$.getJSON("/api/note/consumer/?format=json&alias="
+ pattern
+ "&search=user|club&ordering=normalized_name",
$.getJSON("/api/note/consumer/?format=json&alias=" + pattern + "&search=user|club",
function (consumers) {
// The response arrived too late, we stop the request
if (pattern !== $("#" + field_id).val())