You've already forked AstralRinth
forked from didirus/AstralRinth
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:
@@ -323,13 +323,13 @@ export default {
|
||||
const data = {}
|
||||
|
||||
if (this.name !== this.project.title) {
|
||||
data.title = this.name
|
||||
data.title = this.name.trim()
|
||||
}
|
||||
if (this.slug !== this.project.slug) {
|
||||
data.slug = this.slug
|
||||
data.slug = this.slug.trim()
|
||||
}
|
||||
if (this.summary !== this.project.description) {
|
||||
data.description = this.summary
|
||||
data.description = this.summary.trim()
|
||||
}
|
||||
if (this.clientSide !== this.project.client_side) {
|
||||
data.client_side = this.clientSide
|
||||
|
||||
@@ -189,16 +189,17 @@ export default {
|
||||
const data = {}
|
||||
|
||||
if (this.checkDifference(this.issuesUrl, this.project.issues_url)) {
|
||||
data.issues_url = this.issuesUrl
|
||||
data.issues_url = this.issuesUrl === '' ? null : this.issuesUrl.trim()
|
||||
}
|
||||
if (this.checkDifference(this.sourceUrl, this.project.source_url)) {
|
||||
data.source_url = this.sourceUrl
|
||||
data.source_url = this.sourceUrl === '' ? null : this.sourceUrl.trim()
|
||||
}
|
||||
if (this.checkDifference(this.wikiUrl, this.project.wiki_url)) {
|
||||
data.wiki_url = this.wikiUrl
|
||||
data.wiki_url = this.wikiUrl === '' ? null : this.wikiUrl.trim()
|
||||
}
|
||||
if (this.checkDifference(this.discordUrl, this.project.discord_url)) {
|
||||
data.discord_url = this.discordUrl
|
||||
data.discord_url =
|
||||
this.discordUrl === '' ? null : this.discordUrl.trim()
|
||||
}
|
||||
|
||||
const donationLinks = this.donationLinks.filter(
|
||||
@@ -267,11 +268,14 @@ export default {
|
||||
url: null,
|
||||
})
|
||||
},
|
||||
checkDifference(a, b) {
|
||||
if (!a && !b) {
|
||||
checkDifference(newLink, existingLink) {
|
||||
if (newLink === '' && existingLink !== null) {
|
||||
return true
|
||||
}
|
||||
if (!newLink && !existingLink) {
|
||||
return false
|
||||
}
|
||||
return a !== b
|
||||
return newLink !== existingLink
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
@@ -323,7 +323,7 @@ export default {
|
||||
.data
|
||||
|
||||
const data = {
|
||||
user_id: user.id,
|
||||
user_id: user.id.trim(),
|
||||
}
|
||||
|
||||
await this.$axios.post(
|
||||
|
||||
Reference in New Issue
Block a user