use replace instead of substring

This commit is contained in:
Ulf Gebhardt 2019-06-17 12:16:15 +02:00
parent 794bb08f14
commit 65df4c5a20
No known key found for this signature in database
GPG Key ID: 44C888923CC8E7F3
3 changed files with 4 additions and 4 deletions

View File

@ -45,7 +45,7 @@ MERGE(b:Badge {id: badge._id["$oid"]})
ON CREATE SET
b.key = badge.key,
b.type = badge.type,
b.icon = substring(badge.image.path, 38),
b.icon = replace(badge.image.path, 'https://api-alpha.human-connection.org', ''),
b.status = badge.status,
b.createdAt = badge.createdAt.`$date`,
b.updatedAt = badge.updatedAt.`$date`

View File

@ -131,7 +131,7 @@ MERGE (p:Post {id: post._id["$oid"]})
ON CREATE SET
p.title = post.title,
p.slug = post.slug,
p.image = substring(post.teaserImg, 38),
p.image = replace(post.teaserImg, 'https://api-alpha.human-connection.org', ''),
p.content = post.content,
p.contentExcerpt = post.contentExcerpt,
p.visibility = toLower(post.visibility),

View File

@ -102,8 +102,8 @@ u.name = user.name,
u.slug = user.slug,
u.email = user.email,
u.password = user.password,
u.avatar = substring(user.avatar, 38),
u.coverImg = substring(user.coverImg, 38),
u.avatar = replace(user.avatar, 'https://api-alpha.human-connection.org', ''),
u.coverImg = replace(user.coverImg, 'https://api-alpha.human-connection.org', ''),
u.wasInvited = user.wasInvited,
u.wasSeeded = user.wasSeeded,
u.role = toLower(user.role),