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 {
|
||||
profile_id: string;
|
||||
user_id: string;
|
||||
handle: string;
|
||||
display_name: string;
|
||||
avatar_url: string;
|
||||
|
|
|
|||
|
|
@ -611,7 +611,6 @@ func stripHTMLTags(s string) string {
|
|||
// OfficialProfile represents a profile with is_official = true
|
||||
type OfficialProfile struct {
|
||||
ProfileID string `json:"profile_id"`
|
||||
UserID string `json:"user_id"`
|
||||
Handle string `json:"handle"`
|
||||
DisplayName string `json:"display_name"`
|
||||
AvatarURL string `json:"avatar_url"`
|
||||
|
|
@ -625,7 +624,7 @@ type OfficialProfile struct {
|
|||
// along with whether they have an official_account_configs entry
|
||||
func (s *OfficialAccountsService) ListOfficialProfiles(ctx context.Context) ([]OfficialProfile, error) {
|
||||
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),
|
||||
c.id AS config_id
|
||||
FROM public.profiles p
|
||||
|
|
@ -642,7 +641,7 @@ func (s *OfficialAccountsService) ListOfficialProfiles(ctx context.Context) ([]O
|
|||
for rows.Next() {
|
||||
var p OfficialProfile
|
||||
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
|
||||
}
|
||||
p.ConfigID = configID
|
||||
|
|
|
|||
Loading…
Reference in a new issue