Added result logging.

This commit is contained in:
Tom Butcher 2025-12-27 16:18:11 +00:00
parent 72fea29593
commit ab9818d18f

View File

@ -144,6 +144,7 @@ const ApiContextDebug = () => {
) )
msgApi.destroy() msgApi.destroy()
msgApi.success('fetchObject test completed') msgApi.success('fetchObject test completed')
logger.debug('fetchObject test completed', result)
} catch (err) { } catch (err) {
msgApi.destroy() msgApi.destroy()
msgApi.error('fetchObject test failed') msgApi.error('fetchObject test failed')
@ -160,6 +161,7 @@ const ApiContextDebug = () => {
}) })
msgApi.destroy() msgApi.destroy()
msgApi.success('fetchObjects test completed') msgApi.success('fetchObjects test completed')
logger.debug('fetchObjects test completed', result)
} catch (err) { } catch (err) {
msgApi.destroy() msgApi.destroy()
msgApi.error('fetchObjects test failed') msgApi.error('fetchObjects test failed')
@ -196,6 +198,7 @@ const ApiContextDebug = () => {
) )
msgApi.destroy() msgApi.destroy()
msgApi.success('fetchObjectLock test completed') msgApi.success('fetchObjectLock test completed')
logger.debug('fetchObjectLock test completed', result)
} catch (err) { } catch (err) {
msgApi.destroy() msgApi.destroy()
msgApi.error('fetchObjectLock test failed') msgApi.error('fetchObjectLock test failed')
@ -217,6 +220,7 @@ const ApiContextDebug = () => {
) )
msgApi.destroy() msgApi.destroy()
msgApi.success('updateObject test completed') msgApi.success('updateObject test completed')
logger.debug('updateObject test completed', result)
} catch (err) { } catch (err) {
msgApi.destroy() msgApi.destroy()
msgApi.error('updateObject test failed') msgApi.error('updateObject test failed')
@ -234,6 +238,7 @@ const ApiContextDebug = () => {
const result = await createObject(testInputs.objectType, testData) const result = await createObject(testInputs.objectType, testData)
msgApi.destroy() msgApi.destroy()
msgApi.success('createObject test completed') msgApi.success('createObject test completed')
logger.debug('createObject test completed', result)
} catch (err) { } catch (err) {
msgApi.destroy() msgApi.destroy()
msgApi.error('createObject test failed') msgApi.error('createObject test failed')
@ -250,6 +255,7 @@ const ApiContextDebug = () => {
) )
msgApi.destroy() msgApi.destroy()
msgApi.success('deleteObject test completed') msgApi.success('deleteObject test completed')
logger.debug('deleteObject test completed', result)
} catch (err) { } catch (err) {
msgApi.destroy() msgApi.destroy()
msgApi.error('deleteObject test failed') msgApi.error('deleteObject test failed')
@ -268,6 +274,7 @@ const ApiContextDebug = () => {
const result = await fetchObjectsByProperty(testInputs.objectType, params) const result = await fetchObjectsByProperty(testInputs.objectType, params)
msgApi.destroy() msgApi.destroy()
msgApi.success('fetchObjectsByProperty test completed') msgApi.success('fetchObjectsByProperty test completed')
logger.debug('fetchObjectsByProperty test completed', result)
} catch (err) { } catch (err) {
msgApi.destroy() msgApi.destroy()
msgApi.error('fetchObjectsByProperty test failed') msgApi.error('fetchObjectsByProperty test failed')
@ -281,6 +288,7 @@ const ApiContextDebug = () => {
const result = await fetchSpotlightData(testInputs.query) const result = await fetchSpotlightData(testInputs.query)
msgApi.destroy() msgApi.destroy()
msgApi.success('fetchSpotlightData test completed') msgApi.success('fetchSpotlightData test completed')
logger.debug('fetchSpotlightData test completed', result)
} catch (err) { } catch (err) {
msgApi.destroy() msgApi.destroy()
msgApi.error('fetchSpotlightData test failed') msgApi.error('fetchSpotlightData test failed')
@ -291,13 +299,14 @@ const ApiContextDebug = () => {
const testfetchFileContent = async () => { const testfetchFileContent = async () => {
try { try {
msgApi.loading('Testing fetchFileContent...', 0) msgApi.loading('Testing fetchFileContent...', 0)
await fetchFileContent( const result = await fetchFileContent(
testInputs.objectId, testInputs.objectId,
'gcodefile', 'gcodefile',
testInputs.fileName testInputs.fileName
) )
msgApi.destroy() msgApi.destroy()
msgApi.success('fetchFileContent test completed') msgApi.success('fetchFileContent test completed')
logger.debug('fetchFileContent test completed', result)
} catch (err) { } catch (err) {
msgApi.destroy() msgApi.destroy()
msgApi.error('fetchFileContent test failed') msgApi.error('fetchFileContent test failed')
@ -316,6 +325,7 @@ const ApiContextDebug = () => {
testInputs.scale, testInputs.scale,
(result) => { (result) => {
msgApi.destroy() msgApi.destroy()
logger.debug('fetchTemplatePreview test completed', result)
if (result.success) { if (result.success) {
msgApi.success('fetchTemplatePreview test completed') msgApi.success('fetchTemplatePreview test completed')
} else { } else {
@ -336,6 +346,7 @@ const ApiContextDebug = () => {
const result = await fetchNotes(testInputs.parentId) const result = await fetchNotes(testInputs.parentId)
msgApi.destroy() msgApi.destroy()
msgApi.success('fetchNotes test completed') msgApi.success('fetchNotes test completed')
logger.debug('fetchNotes test completed', result)
} catch (err) { } catch (err) {
msgApi.destroy() msgApi.destroy()
msgApi.error('fetchNotes test failed') msgApi.error('fetchNotes test failed')
@ -349,6 +360,7 @@ const ApiContextDebug = () => {
fetchHostOTP(testInputs.hostId, (result) => { fetchHostOTP(testInputs.hostId, (result) => {
msgApi.destroy() msgApi.destroy()
logger.debug('fetchHostOTP test completed', result)
if (result.otp) { if (result.otp) {
msgApi.success('fetchHostOTP test completed: ' + result.otp) msgApi.success('fetchHostOTP test completed: ' + result.otp)
} else { } else {
@ -372,6 +384,7 @@ const ApiContextDebug = () => {
testInputs.action, testInputs.action,
(result) => { (result) => {
msgApi.destroy() msgApi.destroy()
logger.debug('sendObjectAction test completed', result)
if (result.success) { if (result.success) {
msgApi.success('sendObjectAction test completed') msgApi.success('sendObjectAction test completed')
} else { } else {