resetbutton & almanach edit start

This commit is contained in:
Simon Martens
2025-05-30 19:30:50 +02:00
parent d8e50b27b0
commit 8ea36da40f
28 changed files with 1789 additions and 763 deletions

View File

@@ -4,6 +4,7 @@ import (
"log/slog"
"github.com/pocketbase/pocketbase/core"
"github.com/pocketbase/pocketbase/tools/types"
)
var _ core.RecordProxy = (*Entry)(nil)
@@ -243,3 +244,19 @@ func (e *Entry) Editor() string {
func (e *Entry) SetEditor(editor string) {
e.Set(EDITOR_FIELD, editor)
}
func (e *Entry) Updated() types.DateTime {
return e.GetDateTime(UPDATED_FIELD)
}
func (e *Entry) SetUpdated(updated types.DateTime) {
e.Set(UPDATED_FIELD, updated)
}
func (e *Entry) Created() types.DateTime {
return e.GetDateTime(CREATED_FIELD)
}
func (e *Entry) SetCreated(created types.DateTime) {
e.Set(CREATED_FIELD, created)
}

View File

@@ -133,6 +133,42 @@ func Series_ID(app core.App, id string) (*Series, error) {
return &ret, err
}
func Users_ID(app core.App, id string) (*User, error) {
ret, err := TableByID[User](app, USERS_TABLE, id)
return &ret, err
}
func Sessions_ID(app core.App, id string) (*Session, error) {
ret, err := TableByID[Session](app, SESSIONS_TABLE, id)
return &ret, err
}
func AccessTokens_Token(app core.App, token string) (*AccessToken, error) {
t := HashStringSHA256(token)
return TableByField[*AccessToken](
app,
ACCESS_TOKENS_TABLE,
ACCESS_TOKENS_TOKEN_FIELD,
t,
)
}
func Users_Email(app core.App, email string) (*User, error) {
ret, err := TableByField[User](app, USERS_TABLE, USERS_EMAIL_FIELD, email)
return &ret, err
}
func Sessions_Token(app core.App, token string) (*Session, error) {
t := HashStringSHA256(token)
ret, err := TableByField[Session](
app,
SESSIONS_TABLE,
SESSIONS_TOKEN_FIELD,
t,
)
return &ret, err
}
func Places_IDs(app core.App, ids []any) ([]*Place, error) {
return TableByIDs[*Place](app, PLACES_TABLE, ids)
}