like() {
        return __awaiter(this, void 0, void 0, function* () {
            // Increase the like count in the database
            const result = yield alasql_1.default.promise(`update posts 
             set likes = likes + 1
             where id = ${this.id};
             select likes
             from posts
             where id = ${this.id}`);
            // Update the local state
            if (result.length == 2 && result[0] == 1 && result[1].length == 1)
                this.likes = result[1].likes;
        });
    }
// Increment the current like count, in the database, by one
Increment the current like count, in the database, by one
Increment the current like count in the database by one
like() {
        return __awaiter(this, void 0, void 0, function* () {
            const result = yield alasql_1.default.promise(`update posts 
             set likes = likes + 1
             where id = ${this.id};
             select likes
             from posts
             where id = ${this.id}`);
            if (result.length == 2 && result[0] == 1 && result[1].length == 1)
                this.likes = result[1].likes;
        });
    }
like ( ) { return __awaiter ( this , void 0 , void 0 , function * ( ) { const result = yield alasql_1 . default . promise ( ` ${ this . id } ${ this . id } ` ) ; if ( result . length == 2 && result [ 0 ] == 1 && result [ 1 ] . length == 1 ) this . likes = result [ 1 ] . likes ; } ) ; }
Increment the current like count, in the database, by one
Increment the current like count in the database by one
// Increase the like count in the database // Update the local state