Received: from mail.netlandish.com (mail.netlandish.com [174.136.98.166]) by code.netlandish.com (Postfix) with ESMTP id A7B9C35 for <~netlandish/links-dev@lists.code.netlandish.com>; Sat, 28 Jun 2025 15:00:17 +0000 (UTC) Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=209.85.210.180; helo=mail-pf1-f180.google.com; envelope-from=peter@netlandish.com; receiver= Authentication-Results: mail.netlandish.com; dkim=pass (1024-bit key; unprotected) header.d=netlandish.com header.i=@netlandish.com header.b=ICdzakH8 Received: from mail-pf1-f180.google.com (mail-pf1-f180.google.com [209.85.210.180]) by mail.netlandish.com (Postfix) with ESMTP id 602BD1D642E for <~netlandish/links-dev@lists.code.netlandish.com>; Sat, 28 Jun 2025 15:00:52 +0000 (UTC) Received: by mail-pf1-f180.google.com with SMTP id d2e1a72fcca58-742c7a52e97so3548185b3a.3 for <~netlandish/links-dev@lists.code.netlandish.com>; Sat, 28 Jun 2025 08:00:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=netlandish.com; s=google; t=1751122851; x=1751727651; darn=lists.code.netlandish.com; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=qh2221I7JBfkIDCPBtOcRSvFR4fGmB8/IkuzaFFi30U=; b=ICdzakH8SeGCWoDuJpGBmsY4HUh/+gdSN5R6NmQiyAH9pE5MaMlOJMklBp/lc+R4H0 J1WrZsSg04IJPaq+Kul0UsfiETWaL71015RNbUrQ+Wcpo5h+FK0MM5U5pHoSkOrpkyrg LnxA7d+NE8TuWIdkbeCLQxq7pSoWuyg9//w60= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1751122851; x=1751727651; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=qh2221I7JBfkIDCPBtOcRSvFR4fGmB8/IkuzaFFi30U=; b=B4mFljNFkFOlKoekj5WrmVs4XMd4cZnxOvtuxdafYopmy1EAQ0AxPKgxctWcQNEyAR tQyOd8L1QL/uxxQl2t4ToXWVQlqoppCD8CEJRlkmsj94dSwuZvLHm8fR6hBS12E3pz8b mqeIZVL+gxXuyvzNr6rFQEWqfxY7CAWPsEiqijkdgxFK8un2JUhDvPkNxaxUnVQIQnNF nmEiGgeF/nzdeuQW5MRhSrEYgTcxwDuu9xGJOjvbPSWPN2e/mt81d6bVZjG+J3XYcQil l7V5f/gDZqBR5WMCrzO1MUiUGLWtq/htDTQvoD5xzmsken6qvq0Uw2KYbbsn1iNpQNdS 5P9w== X-Gm-Message-State: AOJu0YwrFxvwvljri24xLi1Nhsprr2rPHLNf7PrV+7JY/dhKBwJHYMLs wCq8JtaNmjijKaZkszMvcoXttqoTKRdnj9HwY1etok8nFLOUOzUqUB7wiIzV/wVSI1nzQL1MviV NJ4Ehots= X-Gm-Gg: ASbGncshfrzF2lLXHlM5e5MjHO/5vGX8G6WlUCrJ7r8Z82N/z9tLrOsRst0c2F52X2I 9/lx0C4+5fEt6ZmHimp/ArORjR5C/e3v3c65URNgQIU0H+ahDwrL32dJGNSZMp+JuBt5J+Pmu4F tXPS4OQGAeGmEOhQmLfMkRT+sQc9uzOCyo4JFgEGfL/ZYQCutI7/x516aWL6BUfKAResqD2/V1D QO7ygPnKeq6/m0J57C+/izy1zmKFoHDqMg1swpx3sYWnnLsWAbGsba/KL3MsuSpt6EyPe+ZEisq 7kZB36RBO88DsxXaLbd46Yh91meR36TZ9uU6Jp1LlSjbpWk3Xxk3SxIArj21SSI= X-Google-Smtp-Source: AGHT+IHMQCQIIY7UIa5miyPR9okXH4418+baolxGY5kVFvjT0eRqvLyJa/kxjCYLnpYc/UC3WA4LKw== X-Received: by 2002:a05:6a00:2394:b0:749:1c27:bcc5 with SMTP id d2e1a72fcca58-74af6f57715mr9421199b3a.22.1751122851292; Sat, 28 Jun 2025 08:00:51 -0700 (PDT) Received: from localhost ([2603:8000:97f0:46d0:f9c:c26a:64f3:59b2]) by smtp.gmail.com with UTF8SMTPSA id d2e1a72fcca58-74af557b3adsm4706801b3a.106.2025.06.28.08.00.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 28 Jun 2025 08:00:50 -0700 (PDT) From: Peter Sanchez To: ~netlandish/links-dev@lists.code.netlandish.com Cc: Peter Sanchez Subject: [PATCH links] Fix error fetching payment history Date: Sat, 28 Jun 2025 09:00:42 -0600 Message-ID: <20250628150048.21436-1-peter@netlandish.com> X-Mailer: git-send-email 2.49.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit --- api/graph/schema.resolvers.go | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/api/graph/schema.resolvers.go b/api/graph/schema.resolvers.go index 956e692..e056216 100644 --- a/api/graph/schema.resolvers.go +++ b/api/graph/schema.resolvers.go @@ -4945,13 +4945,13 @@ func (r *queryResolver) GetPaymentHistory(ctx context.Context, input *model.GetP WithCode(valid.ErrNotFoundCode) return nil, nil } + org = orgs[0] if !user.IsSuperUser() && !org.CanRead(ctx, user) { validator.Error("%s", lt.Translate("This user is not allowed to perform this action")). WithCode(valid.ErrNotFoundCode) return nil, nil } - org = orgs[0] } opts = &database.FilterOptions{ @@ -6618,28 +6618,28 @@ func (r *queryResolver) GetAuditLogs(ctx context.Context, input *model.AuditLogI return nil, nil } - var userId int + var userID int if org == nil && !user.IsSuperUser() { - userId = int(user.ID) + userID = int(user.ID) } if input.UserID != nil && *input.UserID > 0 { if user.IsSuperUser() { - userId = *input.UserID + userID = *input.UserID } else if *input.UserID != int(user.ID) { if org != nil { // If the given user was never part of the organization, no records would be returned. // However if a user is removed from an organization we still want to be able to // view their audit logs - userId = *input.UserID + userID = *input.UserID } } } - if userId > 0 { + if userID > 0 { opts.Filter = sq.And{ opts.Filter, - sq.Eq{"al.user_id": userId}, + sq.Eq{"al.user_id": userID}, } } -- 2.49.0