Fix project settings not allowing you to remove links & trim certain project fields (#895)

* Fix project settings not allowing you to remove links

* Trim project fields

Closes #850
This commit is contained in:
Prospector
2023-01-11 10:00:42 -08:00
committed by GitHub
parent cda18fb957
commit de212322e2
4 changed files with 19 additions and 13 deletions

View File

@@ -153,10 +153,10 @@ export default {
formData.append(
'data',
JSON.stringify({
title: this.name,
title: this.name.trim(),
project_type: projectType.actual,
slug: this.slug,
description: this.description,
description: this.description.trim(),
body: `# Placeholder description
This is your new ${projectType.display}, ${
this.name
@@ -235,9 +235,11 @@ Questions? [Join the Modrinth Discord for support!](https://discord.gg/EUHuJHt)`
updatedName() {
if (!this.manualSlug) {
this.slug = this.name
.trim()
.toLowerCase()
.replaceAll(' ', '-')
.replaceAll(/[^a-zA-Z0-9!@$()`.+,_"-]/g, '')
.replaceAll(/--+/gm, '-')
}
},
},