Целевая страница отсканированного QR-кода (пока без реальной отправки сообщения)
Main daploy / deploy (push) Successful in 37s
Main daploy / deploy (push) Successful in 37s
This commit is contained in:
+10
-2
@@ -43,5 +43,13 @@ export const createQrCodeDocument = async (
|
||||
return qrCodeDoc
|
||||
}
|
||||
|
||||
export const getQrCodeDocument = (uri: string) =>
|
||||
qrCodeDbLocal.get<QRCodeDocument>(`qr_code:${uri}`)
|
||||
export const getQrCodeDocument = (uri: string) => {
|
||||
try {
|
||||
return qrCodeDbLocal.get<QRCodeDocument>(`qr_code:${uri}`)
|
||||
} catch (e) {
|
||||
if ((e as { code: string }).code === 'not_found') {
|
||||
return qrCodeDbRemote.get<QRCodeDocument>(`qr_code:${uri}`)
|
||||
}
|
||||
throw e
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user