fix missing publisher username

This commit is contained in:
SrGooglo 2023-06-07 01:27:04 +00:00
parent f3a6dded5d
commit 4fb8755c32
3 changed files with 11 additions and 1 deletions

View File

@ -130,7 +130,7 @@ export default (props) => {
playlist.publisher && <div className="play_info_statistics_item"> playlist.publisher && <div className="play_info_statistics_item">
<p <p
onClick={() => { onClick={() => {
app.navigation.goToAccount(playlist.user.username) app.navigation.goToAccount(playlist.publisher.username)
}} }}
> >
<Icons.MdPerson /> <Icons.MdPerson />

View File

@ -112,6 +112,13 @@ export default async (req, res) => {
playlist = playlist.toObject() playlist = playlist.toObject()
playlist.publisher = {
user_id: req.session.user_id.toString(),
fullName: userData.fullName,
username: userData.username,
avatar: userData.avatar,
}
playlist.list = await Promise.all(req.body.list.map(async (track, index) => { playlist.list = await Promise.all(req.body.list.map(async (track, index) => {
if (typeof track !== "object") { if (typeof track !== "object") {
return track return track

View File

@ -30,6 +30,9 @@ export default {
type: Date, type: Date,
required: true required: true
}, },
publisher: {
type: Object,
},
public: { public: {
type: Boolean, type: Boolean,
default: true, default: true,