Skip to content

Commit

Permalink
feat: added obligation endpoints.
Browse files Browse the repository at this point in the history
	- POST Method "/api/obligations" -create an obligation and its Map
	- DELETE Method "/api/obligations/:topic" -Delete an obligation by its topic and its Map
	- PATCH Method "/api/obligations/:topic" -Update an obligation by its topic
	- GET Method "/api/obligations" -Get all the obligations
	- GET Method "/api/obligations/:topic" -Get an obligation by its topic

Signed-off-by: Kavya Shukla <[email protected]>
  • Loading branch information
k-avy authored and GMishx committed Dec 4, 2023
1 parent 7b973d0 commit 0b49009
Show file tree
Hide file tree
Showing 5 changed files with 421 additions and 17 deletions.
9 changes: 9 additions & 0 deletions cmd/laas/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,15 @@ func main() {
if err := db.DB.AutoMigrate(&models.ChangeLog{}); err != nil {
log.Fatalf("Failed to automigrate database: %v", err)
}

if err := db.DB.AutoMigrate(&models.Obligation{}); err != nil {
log.Fatalf("Failed to automigrate database: %v", err)
}

if err := db.DB.AutoMigrate(&models.ObligationMap{}); err != nil {
log.Fatalf("Failed to automigrate database: %v", err)
}

db.Populatedb(*populatedb, *datafile)

r := api.Router()
Expand Down
Loading

0 comments on commit 0b49009

Please sign in to comment.