File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -129,7 +129,7 @@ Object.keys(jsApiList).forEach(method => {
129129 return ;
130130 }
131131 if ( method === "ankiSetNoteTags" ) {
132- AnkiDroidJS . prototype [ method ] = async function ( noteId , tags ) {
132+ AnkiDroidJS . prototype [ method ] = async function ( tags ) {
133133 let hasSpaces = false ;
134134 for ( let i = 0 ; i < tags . length ; i ++ ) {
135135 tags [ i ] = tags [ i ] . trim ( ) ;
@@ -147,14 +147,6 @@ Object.keys(jsApiList).forEach(method => {
147147 } ;
148148 return ;
149149 }
150- if ( method === "ankiGetNoteTags" ) {
151- AnkiDroidJS . prototype [ method ] = async function ( noteId ) {
152- const endpoint = jsApiList [ method ] ;
153- const data = JSON . stringify ( { noteId } ) ;
154- return await this . handleRequest ( endpoint , data ) ;
155- } ;
156- return ;
157- }
158150 if ( method === "ankiTtsSpeak" ) {
159151 AnkiDroidJS . prototype [ method ] = async function ( text , queueMode = 0 ) {
160152 const endpoint = jsApiList [ method ] ;
Original file line number Diff line number Diff line change @@ -380,7 +380,7 @@ open class AnkiDroidJsAPI(
380380
381381 " setNoteTags" -> {
382382 val jsonObject = JSONObject (apiParams)
383- val noteId = jsonObject.getLong( " noteId " )
383+ val noteId = currentCard.nid
384384 val tags = jsonObject.getJSONArray(" tags" )
385385 withCol {
386386 fun Note.setTagsFromList (tagList : List <String >) {
@@ -403,8 +403,7 @@ open class AnkiDroidJsAPI(
403403 }
404404
405405 " getNoteTags" -> {
406- val jsonObject = JSONObject (apiParams)
407- val noteId = jsonObject.getLong(" noteId" )
406+ val noteId = currentCard.nid
408407 val noteTags =
409408 withCol {
410409 getNote(noteId).tags
Original file line number Diff line number Diff line change @@ -428,7 +428,7 @@ class AnkiDroidJsAPITest : RobolectricTest() {
428428
429429 // test get tags for note
430430 val expectedTags = n.tags
431- val response = getDataFromRequest(" getNoteTags" , jsapi, jsonObjectOf( " noteId " to n.id) )
431+ val response = getDataFromRequest(" getNoteTags" , jsapi)
432432 val jsonResponse = JSONObject (response)
433433 val actualTags = JSONArray (jsonResponse.getString(" value" ))
434434
You can’t perform that action at this time.
0 commit comments