switched UserId and CertificateId

This commit is contained in:
bill bittner 2017-09-21 00:18:34 -07:00
parent 9041d4d4dc
commit 18f16e4cce
6 changed files with 43 additions and 7 deletions

View file

@ -0,0 +1,34 @@
module.exports = {
up: (queryInterface, Sequelize) => {
// logic for transforming into the new state
const p1 = queryInterface.addColumn(
'User',
'CertificateId',
{
type : Sequelize.STRING,
allowNull: true,
}
);
const p2 = queryInterface.removeColumn(
'Certificate',
'UserId'
);
return Promise.all([p1, p2]);
},
down: (queryInterface, Sequelize) => {
// logic for reverting the changes
const p1 = queryInterface.removeColumn(
'Certificate',
'UserId'
);
const p2 = queryInterface.addColumn(
'User',
'CertificateId',
{
type : Sequelize.STRING,
allowNull: true,
}
);
return Promise.all([p1, p2]);
},
};

View file

@ -39,10 +39,12 @@ module.exports = new PassportLocalStrategy(
address,
CertificateId : certificate.id,
};
logger.debug('userData >', userData);
return db.User.create(userData);
}).then(user => {
logger.debug('user result >', user.dataValues);
logger.debug('User record was created successfully');
return done(null, user); // user.datavalues?
return done(null, user);
})
.catch(error => {
logger.debug(error);

View file

@ -164,17 +164,17 @@ input:-webkit-autofill {
-webkit-box-shadow: 0 0 0px 1000px white inset;
}
.input-text {
.input-text, .select, .textarea {
outline: none;
border: 0px;
background-color: white;
}
.input-text--primary {
.input-text--primary, .select--primary, .textarea--primary {
border-bottom: 1px solid blue;
}
.input-text--primary:focus {
.input-text--primary:focus, .select--primary:focus, .textarea--primary:focus {
border-bottom: 1px solid grey;
}

View file

@ -2,7 +2,7 @@
<p>
<div id="input-error-channel-select" class="info-message info-message--failure"></div>
<label for="channel-name-select">Channel:</label>
<select type="text" id="channel-name-select" name="channel" value="channel" onclick="toggleChannel(event)">
<select type="text" id="channel-name-select" class="select select--primary" value="channel" onclick="toggleChannel(event)">
{{#if user}}
<option value="{{user.channelName}}" >{{user.channelName}}</option>
{{/if}}

View file

@ -9,7 +9,7 @@
</tr>
<tr>
<td><label for="publish-description">Description: </label></td>
<td><textarea rows="2" id="publish-description"> </textarea></td>
<td><textarea rows="2" id="publish-description" class="textarea textarea--primary"> </textarea></td>
</tr>
<tr>
<td><label for="publish-license">License:* </label></td>

View file

@ -20,7 +20,7 @@
</p>
</div>
<div class="stop-float">
{{> channelSelection}}
{{> publishChannel}}
</div>
<div class="stop-float">
{{> publishDetails}}