const { pool } = require('./db');
async function recordEvent(client, { eventId, type, payload }) {
const { rows } = await client.query(
`INSERT INTO webhook_events (event_id, type, payload, status)
VALUES ($1, $2, $3, 'received')
class LikesController < ApplicationController
before_action :set_post
def create
@like = @post.likes.find_or_create_by(user: current_user)