developing of the new database schema for the faq_ tables; editing of the existing API to match the modifications

developing of the new database schema for the faq_ tables; editing of the existing API to match the modifications
The # of like related to a response is represented by the number of
rows having same FAQ_ResponseId foreign key. A simple select query can
retrieve the number of like of that response, and the unicity of the
primary key allows implicitly to allow only one like for every expert.
It also allows the expert to remove its like choice.
To retrieve the data we can create an inner query that count the
number of responses and pass the output to the parent query that
basically add the result for every response rows.

2014-11-10 17:42 GMT-05:00 Jemuel Young <notifications@github.com>:
> In expert_operations.php:
>
>> +    );
>> +
>> +	$app->response->headers->set('Content-Type', 'application/json');
>> +	$app->response->write(json_encode($recentQuestions));
>> +});
>> +
>> +/**
>> + * A function that will accept a like to to a specific response. (Ruben)
>> + *
>> + * @param int $e_id id of the expert, e.g. 5023.
>> + * @param int $r_id id of the response of another expert, e.g. 633491.
>> + *
>> + * @return none
>> + */
>> +
>> +$app->get('/add_like_response/:e_id/:r_id', function($e_id, $r_id) use
>> ($app) {
>
> Sorry, I meant responses, not questions. This function adds the ability to
> 'like' something so there should be some way of pulling those likes back to
> the frontend.
>
> —
> Reply to this email directly or view it on GitHub.