add stats about credit in use account and update dates for home graph

This commit is contained in:
osaajani 2021-06-14 19:48:42 +02:00
parent 03ae69b82a
commit c3637ab3ab
9 changed files with 90 additions and 31 deletions

View file

@ -222,7 +222,7 @@ namespace controllers\internals;
//If we reached our max quota, do not send the message
$internal_quota = new Quota($this->bdd);
$nb_credits = $internal_quota::compute_credits_for_message($text); //Calculate how much credit the message require
if ($internal_quota->has_enough_credit($id_user, $nb_credits))
if (!$internal_quota->has_enough_credit($id_user, $nb_credits))
{
$return['error'] = false;
$return['error_message'] = 'Not enough credit to send message.';