Initial
This commit is contained in:
14
app/controllers/notification_controller.rb
Normal file
14
app/controllers/notification_controller.rb
Normal file
@@ -0,0 +1,14 @@
|
||||
class NotificationController < ApplicationController
|
||||
|
||||
# POST /api/notification
|
||||
def create
|
||||
puts "Se ha creado una notificación, se va a crear una solicitud"
|
||||
|
||||
# se recibe: {"id" => 1, "user_id" => 2, "book_id" => 1, "returned" => 1, "created_at" => "2025-12-30T23:43:23.170Z", "updated_at" => "2026-03-23T21:43:39.950Z", "notification" => {"id" => 1, "user_id" => 2, "book_id" => 1, "returned" => 1, "created_at" => "2025-12-30T23:43:23.170Z", "updated_at" => "2026-03-23T21:43:39.950Z"}}
|
||||
|
||||
Solicitud.new(nombre: "User_id #{params["user_id"]}", email: "draft@draft.com", ciudad: "remota", estado: "remoto", direccion: "127.0.0.1", detalles: "Lend", presupuesto: "1.00", tiempo_de_entrega: "inmediato", telefono: "ninguno", contacto_de_preferencia_id: 1, categoria_id: 1, status_id: 1, notas: "Remote call", verificado: "Sí" ).save
|
||||
|
||||
render json: {message: "created"}, status: :created
|
||||
end
|
||||
|
||||
end
|
||||
Reference in New Issue
Block a user