summaryrefslogtreecommitdiff
path: root/nexus/api/realms
diff options
context:
space:
mode:
authorBobby <[email protected]>2026-03-29 22:52:46 +0530
committerBobby <[email protected]>2026-03-29 22:52:46 +0530
commit9eb9b7f4bd552a641235764f66483e1f940fcfd9 (patch)
treeda520b923b5e6758d5457b6233dd6671fc640914 /nexus/api/realms
parent65a143a0871c35989b7c7ea6723d39a0585c089e (diff)
downloadechoes-of-vaelun-main.tar.xz
echoes-of-vaelun-main.zip
feat: nexus account manager scaffold with auth, characters, realmsHEADmain
Diffstat (limited to 'nexus/api/realms')
-rw-r--r--nexus/api/realms/realms.go23
1 files changed, 23 insertions, 0 deletions
diff --git a/nexus/api/realms/realms.go b/nexus/api/realms/realms.go
new file mode 100644
index 0000000..025949f
--- /dev/null
+++ b/nexus/api/realms/realms.go
@@ -0,0 +1,23 @@
+package realms
+
+import (
+ "nexus/repositories/realm"
+ realmTypes "nexus/types/realm"
+ "nexus/utils/shortcuts"
+
+ "github.com/gofiber/fiber/v2"
+)
+
+func Index(context *fiber.Ctx) error {
+ realms, err := realm.FindAll()
+ if err != nil {
+ return shortcuts.ServiceError(fiber.StatusInternalServerError, err.Error())
+ }
+
+ response := make([]realmTypes.Response, len(realms))
+ for i, r := range realms {
+ response[i] = r.ToResponse()
+ }
+
+ return shortcuts.JSON(context, response)
+}