fix: remove user_id from profiles query - column doesn't exist
This commit is contained in:
parent
7b493bcd67
commit
cae9a479da
|
|
@ -117,7 +117,6 @@ interface Config {
|
||||||
|
|
||||||
interface OfficialProfile {
|
interface OfficialProfile {
|
||||||
profile_id: string;
|
profile_id: string;
|
||||||
user_id: string;
|
|
||||||
handle: string;
|
handle: string;
|
||||||
display_name: string;
|
display_name: string;
|
||||||
avatar_url: string;
|
avatar_url: string;
|
||||||
|
|
|
||||||
|
|
@ -611,7 +611,6 @@ func stripHTMLTags(s string) string {
|
||||||
// OfficialProfile represents a profile with is_official = true
|
// OfficialProfile represents a profile with is_official = true
|
||||||
type OfficialProfile struct {
|
type OfficialProfile struct {
|
||||||
ProfileID string `json:"profile_id"`
|
ProfileID string `json:"profile_id"`
|
||||||
UserID string `json:"user_id"`
|
|
||||||
Handle string `json:"handle"`
|
Handle string `json:"handle"`
|
||||||
DisplayName string `json:"display_name"`
|
DisplayName string `json:"display_name"`
|
||||||
AvatarURL string `json:"avatar_url"`
|
AvatarURL string `json:"avatar_url"`
|
||||||
|
|
@ -625,7 +624,7 @@ type OfficialProfile struct {
|
||||||
// along with whether they have an official_account_configs entry
|
// along with whether they have an official_account_configs entry
|
||||||
func (s *OfficialAccountsService) ListOfficialProfiles(ctx context.Context) ([]OfficialProfile, error) {
|
func (s *OfficialAccountsService) ListOfficialProfiles(ctx context.Context) ([]OfficialProfile, error) {
|
||||||
rows, err := s.pool.Query(ctx, `
|
rows, err := s.pool.Query(ctx, `
|
||||||
SELECT p.id, p.user_id, p.handle, p.display_name, COALESCE(p.avatar_url, ''),
|
SELECT p.id, p.handle, p.display_name, COALESCE(p.avatar_url, ''),
|
||||||
COALESCE(p.bio, ''), COALESCE(p.is_verified, false),
|
COALESCE(p.bio, ''), COALESCE(p.is_verified, false),
|
||||||
c.id AS config_id
|
c.id AS config_id
|
||||||
FROM public.profiles p
|
FROM public.profiles p
|
||||||
|
|
@ -642,7 +641,7 @@ func (s *OfficialAccountsService) ListOfficialProfiles(ctx context.Context) ([]O
|
||||||
for rows.Next() {
|
for rows.Next() {
|
||||||
var p OfficialProfile
|
var p OfficialProfile
|
||||||
var configID *string
|
var configID *string
|
||||||
if err := rows.Scan(&p.ProfileID, &p.UserID, &p.Handle, &p.DisplayName, &p.AvatarURL, &p.Bio, &p.IsVerified, &configID); err != nil {
|
if err := rows.Scan(&p.ProfileID, &p.Handle, &p.DisplayName, &p.AvatarURL, &p.Bio, &p.IsVerified, &configID); err != nil {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
p.ConfigID = configID
|
p.ConfigID = configID
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue