Small bug fixes
This commit is contained in:
1 parent
e952dd7b7a
commit
9474fa18f2
2 files changed
+2
-2
No files matched your search
@@ -16,6 +16,7 @@ const props = defineProps<CardProps>()
|
|||||||
@use "@/styles/variables" as *;
|
@use "@/styles/variables" as *;
|
||||||
|
|
||||||
.card {
|
.card {
|
||||||
|
background-color: $color-background;
|
||||||
border: 1px solid $color-border;
|
border: 1px solid $color-border;
|
||||||
border-radius: $border-radius-standard;
|
border-radius: $border-radius-standard;
|
||||||
padding: 1rem;
|
padding: 1rem;
|
||||||
|
|||||||
+1
-2
@@ -48,14 +48,13 @@ export const cfetch = async (
|
|||||||
|
|
||||||
for (const [key, val] of Object.entries(config.data)) {
|
for (const [key, val] of Object.entries(config.data)) {
|
||||||
if (Array.isArray(val)) {
|
if (Array.isArray(val)) {
|
||||||
val.forEach((v) => form.append(`${key}[]`, v))
|
val.forEach((v) => form.append(key, v)) // key as-is, no []
|
||||||
} else if (val !== undefined && val !== null) {
|
} else if (val !== undefined && val !== null) {
|
||||||
form.append(key, val as any)
|
form.append(key, val as any)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
config.data = form
|
config.data = form
|
||||||
|
|
||||||
if (!config.headers) config.headers = {}
|
if (!config.headers) config.headers = {}
|
||||||
delete config.headers["Content-Type"]
|
delete config.headers["Content-Type"]
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user