Can't find the reason that the then() not working

Hi .
When i call the test1 function by a button, then() is not working.
The testQuery itself seems successfully work. But any of handler(resolve, reject) is not called.
Please let me know what is wrong in my code.

jsObject1

export default {
	test1: function (params) {
		testQuery.run(params)
		.then(() => {console.log('resolve')}, 
			() => {console.log('reject')})
	}
}

the button’s onclick code

{{
jsObject1.test1({
	value: '1',
	opt0: 'a',
	opt1: b'
})
}}

Hello! You need to return the promise from the function to get this to work

1 Like

@srrrrrr27 You can refer to the doc here for how to return the promise - JavaScript Promises - Appsmith

1 Like

Oh thanks. Resolved!!! :smiley: :