Compare commits

..

2 Commits

Author SHA1 Message Date
Julien Calixte
0099e51f94 fix(transaction): initialize CurrencyInput with a real currency code
vue-currency-input required a currency code for Intl.NumberFormat;
passing undefined threw inside the mount watcher, leaving the input
without listeners so amount stayed null on submit.

Use CurrencyDisplay.hidden to keep the symbol out of the field since
the currency selector is rendered separately.
2026-06-02 21:24:39 +02:00
Julien Calixte
901f7f4c02 fix(sync): send credentials on cross-origin couchdb requests
PouchDB 8+ ignores the legacy ajax config, so withCredentials had no
effect and the AuthSession cookie was stripped from cross-origin sync
requests. Switch to a fetch wrapper that sets credentials: 'include'
so replication authenticates and pushes local docs to the remote.
2026-06-02 21:23:47 +02:00
2 changed files with 7 additions and 6 deletions

View File

@@ -1,6 +1,6 @@
<script setup lang="ts"> <script setup lang="ts">
import { watch } from 'vue' import { watch } from 'vue'
import { useCurrencyInput } from 'vue-currency-input' import { useCurrencyInput, CurrencyDisplay } from 'vue-currency-input'
const props = withDefaults( const props = withDefaults(
defineProps<{ defineProps<{
@@ -23,7 +23,8 @@ const props = withDefaults(
defineEmits<{ 'update:modelValue': [value: number | null] }>() defineEmits<{ 'update:modelValue': [value: number | null] }>()
const { inputRef, setValue } = useCurrencyInput({ const { inputRef, setValue } = useCurrencyInput({
currency: undefined as unknown as string, currency: 'USD',
currencyDisplay: CurrencyDisplay.hidden,
locale: props.locale, locale: props.locale,
precision: props.precision, precision: props.precision,
hideCurrencySymbolOnFocus: false, hideCurrencySymbolOnFocus: false,

View File

@@ -11,11 +11,11 @@ PouchDb.plugin(PouchDbAuthentication)
const emit = debounce((ev: typeof SYNC, arr?: string[]) => bus.emit(ev, arr), 150) const emit = debounce((ev: typeof SYNC, arr?: string[]) => bus.emit(ev, arr), 150)
const remoteConfig = { const remoteConfig: PouchDB.Configuration.RemoteDatabaseConfiguration = {
skip_setup: true, skip_setup: true,
ajax: { fetch: (url, opts) => {
cache: true, const init: RequestInit = { ...(opts ?? {}), credentials: 'include' }
withCredentials: true return PouchDb.fetch(url as RequestInfo, init)
} }
} }
const LOCALE_DB = 'VAQUANT_LOCALE_DB' const LOCALE_DB = 'VAQUANT_LOCALE_DB'