Redirect added after channel creation.
This commit is contained in:
parent
17e736ab1a
commit
567eb5b574
|
|
@ -229,7 +229,20 @@ channelSchema.statics.register = async function(channelObj, ownerObj){
|
||||||
rank: "admin"
|
rank: "admin"
|
||||||
}];
|
}];
|
||||||
|
|
||||||
const newChannel = await this.create((thumbnail ? {id, name, description, thumbnail, rankList} : {id, name, description, rankList}));
|
const newChannelObj = {
|
||||||
|
id,
|
||||||
|
name,
|
||||||
|
description,
|
||||||
|
thumbnail,
|
||||||
|
rankList,
|
||||||
|
media: {
|
||||||
|
nowPlaying: null,
|
||||||
|
scheduledMedia: [],
|
||||||
|
archived: []
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
const newChannel = await this.create(newChannelObj);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -25,7 +25,6 @@ const playlistMediaProperties = new mongoose.Schema({
|
||||||
uuid: {
|
uuid: {
|
||||||
type: mongoose.SchemaTypes.UUID,
|
type: mongoose.SchemaTypes.UUID,
|
||||||
required:true,
|
required:true,
|
||||||
unique: true,
|
|
||||||
default: crypto.randomUUID()
|
default: crypto.randomUUID()
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -24,7 +24,6 @@ const playlistSchema = new mongoose.Schema({
|
||||||
name: {
|
name: {
|
||||||
type: mongoose.SchemaTypes.String,
|
type: mongoose.SchemaTypes.String,
|
||||||
required: true,
|
required: true,
|
||||||
unique: true
|
|
||||||
},
|
},
|
||||||
media: [playlistMediaSchema],
|
media: [playlistMediaSchema],
|
||||||
defaultTitles:[{
|
defaultTitles:[{
|
||||||
|
|
|
||||||
|
|
@ -37,7 +37,6 @@ const queuedProperties = new mongoose.Schema({
|
||||||
uuid: {
|
uuid: {
|
||||||
type: mongoose.SchemaTypes.UUID,
|
type: mongoose.SchemaTypes.UUID,
|
||||||
required: true,
|
required: true,
|
||||||
unique: true
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -57,18 +57,4 @@ class registerPrompt{
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const registerForm = new registerPrompt();
|
const registerForm = new registerPrompt();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/*async function registerPrompt(event){
|
|
||||||
if(!event || event.key == "Enter"){
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
//assign events
|
|
||||||
document.querySelector("#register-channel-name").addEventListener("keydown", registerPrompt)
|
|
||||||
document.querySelector("#register-description").addEventListener("keydown", registerPrompt)
|
|
||||||
document.querySelector("#register-thumbnail").addEventListener("keydown", registerPrompt)*/
|
|
||||||
|
|
@ -789,7 +789,7 @@ class canopyAjaxUtils{
|
||||||
});
|
});
|
||||||
|
|
||||||
if(response.ok){
|
if(response.ok){
|
||||||
location = "/";
|
location = `/c/${name}/settings`;
|
||||||
}else{
|
}else{
|
||||||
utils.ux.displayResponseError(await response.json());
|
utils.ux.displayResponseError(await response.json());
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue