skip to Main Content

Postgresql – ERROR: insert or update on table "promos" violates foreign key constraint "fk_businesses_promos"

I'm trying to bulid a REST API using go and specifically GORM. My entities look like this: type Business struct { ID string `json:"id" gorm:"primaryKey;not null;type:uuid;default:gen_random_uuid()"` CreatedAt time.Time `json:"-"` UpdatedAt time.Time `json:"-"` Email string `json:"email" gorm:"uniqueIndex;not null;"` Password []byte `json:"-"`…

VIEW QUESTION

Laravel – New route doesn't exist

I have added new route to my api.php Route::get('/test', [WebinarController::class, 'index']); I have also added use AppHttpControllersWebinarController; to my api.php And I have created new controller WebinarController where I return "it works"; When I go to Postman and call http://127.0.0.1:8000/api/test…

VIEW QUESTION

Json – Why LocalDateTime is serialized as array when return as ReponseBody in springboot?

I want to get the dates in a format of dd/MM/yyyy so,I wrote this code first: @GetMapping("/testAjax.json") public ResponseBody<?> AjaxResponse testAjax(){ AjaxResponse response = new AjaxResponse(); DateTimeTest test = new DateTimeTest(); test.setDateTime(LocalDateTime.now()); response.addResponse("date", LocalDateTime.now()); response.addResponse("test", test); return response; }` and…

VIEW QUESTION
Back To Top
Search