Browse Source

qrscanner - fix api parameter error

pull/4898/head
Daniel Spaude 2 years ago
parent
commit
8f2213ae97
No known key found for this signature in database
GPG Key ID: 654A3D1FA4F35FFE
  1. 16
      packages/nc-gui/components/smartsheet/qr-scanner-button/QrScannerButton.vue

16
packages/nc-gui/components/smartsheet/qr-scanner-button/QrScannerButton.vue

@ -39,21 +39,18 @@ const entry = ref<Entry | null>(null)
const selectedCodeColumnIdToScanFor = ref('')
const onDecode = async (qrCodeValue: string) => {
alert(qrCodeValue)
try {
showQrCodeScanner.value = false
const whereClause = `(${selectedCodeColumnIdToScanFor.value},eq,${qrCodeValue})`
const nameOfSelectedColumnToScanFor = meta.value?.columns?.find(
(column) => column.id === selectedCodeColumnIdToScanFor.value,
)?.title
const whereClause = `(${nameOfSelectedColumnToScanFor},eq,${qrCodeValue})`
const foundRowForQrCode = await $api.dbViewRow.findOne(NOCO, project.value!.id!, meta.value!.id!, view.value!.title!, {
where: whereClause,
})
console.log('foundRowForQrCode', foundRowForQrCode)
const rowIdOfFoundRow = meta.value?.id && foundRowForQrCode[meta.value.id]
console.log('rowIdOfFoundRow', rowIdOfFoundRow)
const primaryKeyValueForFoundRow = extractPkFromRow(foundRowForQrCode, meta!.value!.columns!)
console.log('primaryKeyValueForFoundRow', primaryKeyValueForFoundRow)
router.push({
query: {
@ -69,14 +66,9 @@ const onDecode = async (qrCodeValue: string) => {
const scannerIsReady = ref(false)
const onLoaded = async () => {
// alert('FOO')
scannerIsReady.value = true
}
const FOO = async () => {
alert('FOO')
}
// TODO: ensure that when modal is closed, scannerIsReady gets set back to false
</script>

Loading…
Cancel
Save