2026-04-21 19:19:39 +00:00
|
|
|
package platform
|
|
|
|
|
|
|
|
|
|
import (
|
|
|
|
|
"context"
|
|
|
|
|
|
2026-05-19 15:33:57 +00:00
|
|
|
"source.gleipnir.technology/Gleipnir/nidus-sync/db"
|
|
|
|
|
querypublic "source.gleipnir.technology/Gleipnir/nidus-sync/db/query/public"
|
|
|
|
|
"source.gleipnir.technology/Gleipnir/nidus-sync/platform/types"
|
2026-04-21 19:19:39 +00:00
|
|
|
)
|
|
|
|
|
|
2026-05-16 18:12:01 +00:00
|
|
|
func MailerByID(ctx context.Context, user User, id int32) (*types.Mailer, error) {
|
|
|
|
|
return querypublic.MailerFromID(ctx, db.PGInstance.PGXPool, int64(user.Organization.ID), int64(id))
|
|
|
|
|
}
|
2026-05-15 20:10:14 +00:00
|
|
|
func MailerList(ctx context.Context, user User, limit int) ([]types.Mailer, error) {
|
|
|
|
|
return querypublic.MailersFromOrganizationID(ctx, db.PGInstance.PGXPool, int64(user.Organization.ID), int64(limit))
|
2026-04-21 19:19:39 +00:00
|
|
|
}
|