export DB, Event creation, broker with city/state
This commit is contained in:
20
bizmatch-server/src/event/event.controller.ts
Normal file
20
bizmatch-server/src/event/event.controller.ts
Normal file
@@ -0,0 +1,20 @@
|
||||
import { Body, Controller, Headers, Ip, Post } from '@nestjs/common';
|
||||
import { ListingEvent } from 'src/models/db.model';
|
||||
import { EventService } from './event.service';
|
||||
|
||||
@Controller('event')
|
||||
export class EventController {
|
||||
constructor(private eventService: EventService) {}
|
||||
@Post()
|
||||
async createEvent(
|
||||
@Body() event: ListingEvent, // Struktur des Body-Objekts entsprechend anpassen
|
||||
@Ip() userIp: string, // IP Adresse des Clients
|
||||
@Headers('user-agent') userAgent: string, // User-Agent des Clients
|
||||
) {
|
||||
//const { listingId, userId, eventType, locationCountry, locationCity, locationLat, locationLng, referrer, additionalData } = body;
|
||||
event.userIp = userIp;
|
||||
event.userAgent = userAgent;
|
||||
this.eventService.createEvent(event);
|
||||
return { message: 'Event gespeichert' };
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user