Skip to content
Snippets Groups Projects
Commit 3f8b9e7d authored by Wilson JALLET's avatar Wilson JALLET :money_with_wings:
Browse files

add for_answer column on questions, resolve type with it

last type is PrivatePost
parent 4adf25e2
No related branches found
No related tags found
No related merge requests found
exports.up = async function(knex, Promise) {
await knex.schema.table('questions', table => {
table.string('for_answer', 128);
});
};
exports.down = async function(knex, Promise) {
await knex.schema.table('questions', table => {
table.dropColumn('for_answer');
});
};
......@@ -16,8 +16,10 @@ const MessageResolvers = {
if (obj.for_question) {
return "Answer";
}
return "Question";
if (obj.for_answer) {
return "Question";
}
return "PrivatePost";
}
},
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment