mirror of
https://github.com/Ocelot-Social-Community/Ocelot-Social.git
synced 2025-12-13 07:46:06 +00:00
Update frontend to display urls, update currentUser
This commit is contained in:
parent
59e488f48a
commit
edd37db8fe
@ -58,7 +58,8 @@ export default {
|
||||
}),
|
||||
socialMediaLinks() {
|
||||
const { socialMedia = [] } = this.currentUser
|
||||
return socialMedia.map(url => {
|
||||
return socialMedia.map(socialMedia => {
|
||||
const { url } = socialMedia
|
||||
const matches = url.match(
|
||||
/^(?:https?:\/\/)?(?:[^@\n])?(?:www\.)?([^:\/\n?]+)/g
|
||||
)
|
||||
@ -77,14 +78,19 @@ export default {
|
||||
.mutate({
|
||||
mutation: gql`
|
||||
mutation($url: String!) {
|
||||
CreateSocialMedia(url: $url)
|
||||
CreateSocialMedia(url: $url) {
|
||||
url
|
||||
}
|
||||
}
|
||||
`,
|
||||
variables: {
|
||||
url: this.value
|
||||
},
|
||||
update: (store, { data }) => {
|
||||
const socialMedia = data.addSocialMedia
|
||||
const socialMedia = [
|
||||
...this.currentUser.socialMedia,
|
||||
data.CreateSocialMedia
|
||||
]
|
||||
this.setCurrentUser({
|
||||
...this.currentUser,
|
||||
socialMedia
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user