'use strict';

const db = require(`${global.__base}/src/middleware/db`);

const statusMessage = require(`${global.__base}/src/utils/request-status-message`);

module.exports = {
    GET: (request, reply) => {
        db.getConnection((err, connection) => {
            connection.query('CALL specificTopic_generalTopic_select', {}, (error, results, fields) => {
                connection.release();

                if (error) throw error;

                if (results[0][0].SUCCESS === 0) { reply(statusMessage.BAD_REQUEST); }
                else { reply(results[0][0]); }

            });
        });
    }
};

@@ -466,22 +466,19 @@
 ults
-%5B0%5D%5B0%5D.SUCCESS
+.fieldCount
  ===
@@ -507,19 +507,17 @@
 age.
-BAD_REQUEST
+NOT_FOUND
 ); %7D
@@ -560,15 +560,13 @@
 s%5B0%5D
-%5B0%5D
 ); %7D
+ 
 %0A%0A  

fix Spected response object