refactor: call database functions from app.Server.Database instead of directly from db

This commit is contained in:
2024-08-19 21:00:46 +07:00
parent 6a183f2c4e
commit fa2f4e8a87
18 changed files with 69 additions and 63 deletions

View File

@ -11,7 +11,6 @@ import (
"sync"
"time"
"github.com/fossyy/filekeeper/db"
"github.com/fossyy/filekeeper/types"
"github.com/fossyy/filekeeper/types/models"
"github.com/fossyy/filekeeper/utils"
@ -102,7 +101,7 @@ func POST(w http.ResponseWriter, r *http.Request) {
Password: hashedPassword,
}
if registered := db.DB.IsUserRegistered(userEmail, username); registered {
if registered := app.Server.Database.IsUserRegistered(userEmail, username); registered {
component := signupView.Main("Filekeeper - Sign up Page", types.Message{
Code: 0,
Message: "Email or Username has been registered",