Skip to content

Commit

Permalink
1571: increase max request size from 1MB to 5MB, fix getDiscount
Browse files Browse the repository at this point in the history
  • Loading branch information
f1sh1918 committed Sep 14, 2024
1 parent e1f49cc commit e515ae2
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ const StoresImportDuplicates = ({ entries }: StoresImportDuplicatesProps): React
<Container>
Die CSV enthält doppelte Einträge:
{entries.map((entry, index) => (
<span key={index}>Eintrag {entry.join(' und ')} sind identisch.</span>
<span key={index}>Eintrag {entry.join(', ')} sind identisch.</span>
))}
Bitte löschen Sie die doppelten Einträge.
</Container>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ class WebService {
cfg.bundledPlugins.enableDevLogging()
cfg.bundledPlugins.enableCors { cors -> cors.addRule { it.anyHost() } }
}
cfg.http.maxRequestSize = 5000000
cfg.staticFiles.add {
it.directory = "/graphiql"
it.hostedPath = "/graphiql"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,14 @@ import app.ehrenamtskarte.backend.stores.COUNTRY_CODE
import app.ehrenamtskarte.backend.stores.importer.common.types.AcceptingStore
import app.ehrenamtskarte.backend.stores.webservice.schema.types.CSVAcceptingStore

fun getDiscount(discountDE: String?, discountEN: String?): String? {
if (discountDE.isNullOrEmpty() && discountEN.isNullOrEmpty()) {
return null
}
return discountDE.orEmpty() + "\n\n" + discountEN.orEmpty()
fun getDiscount(discounts: MutableList<String?>): String {
discounts.removeIf { it.isNullOrEmpty() }
return discounts.joinToString("\n\n")
}
fun mapCsvToStore(csvStore: CSVAcceptingStore): AcceptingStore {
val discount = getDiscount(csvStore.discountDE, csvStore.discountEN)
val discount = getDiscount(mutableListOf(csvStore.discountDE, csvStore.discountEN))
return AcceptingStore(
csvStore.name!!, COUNTRY_CODE, csvStore.location!!, csvStore.postalCode!!, csvStore.street!!, csvStore.houseNumber!!, "", csvStore.longitude!!.toDouble(), csvStore.latitude!!.toDouble(), csvStore.categoryId!!.toInt(), csvStore.email.clean(false), csvStore.telephone.clean(false),
csvStore.homepage.clean(false), discount, null, null
csvStore.homepage.clean(false), discount.clean(false), null, null
)
}

0 comments on commit e515ae2

Please sign in to comment.