This repository has been archived on 2023-11-13. You can view files and clone it, but cannot push or open issues or pull requests.
imagini/internal/query/users.go

27 lines
515 B
Go
Raw Normal View History

2021-01-12 04:48:32 +00:00
package query
2021-01-10 00:44:02 +00:00
import (
2021-01-12 04:48:32 +00:00
"gorm.io/gorm"
2021-01-10 00:44:02 +00:00
"reichard.io/imagini/internal/models"
)
2021-01-12 04:48:32 +00:00
func CreateUser (db *gorm.DB, user models.User) error {
2021-01-10 00:44:02 +00:00
err := db.Create(&user).Error
return err
}
2021-01-12 04:48:32 +00:00
func User (db *gorm.DB, user models.User) (models.User, error) {
2021-01-10 00:44:02 +00:00
var foundUser models.User
var count int64
err := db.Where(&user).First(&foundUser).Count(&count).Error
return foundUser, err
}
func DeleteUser (user models.User) error {
return nil
}
func UpdatePassword (user models.User, pw string) {
}