repos / pico

pico services - prose.sh, pastes.sh, imgs.sh, feeds.sh, pgs.sh
git clone https://github.com/picosh/pico.git

commit
cae0a48
parent
e157c1d
author
Eric Bower
date
2023-01-13 15:33:09 +0000 UTC
chore: cleanup old code
2 files changed,  +3, -59
M db/postgres/storage.go
+0, -59
 1@@ -132,18 +132,6 @@ var (
 2 		cur_space = $3
 3 	ORDER BY publish_at DESC
 4 	LIMIT $4 OFFSET $5`, SelectPost)
 5-
 6-	/* sqlSelectUserPostsWithTags = fmt.Sprintf(`
 7-	SELECT %s, STRING_AGG(coalesce(post_tags.name, ''), ',') tags
 8-	FROM posts
 9-	LEFT OUTER JOIN app_users ON app_users.id = posts.user_id
10-	LEFT OUTER JOIN post_tags ON post_tags.post_id = posts.id
11-	WHERE
12-		user_id = $1 AND
13-		publish_at::date <= CURRENT_DATE AND
14-		cur_space = $2
15-	GROUP BY %s
16-	ORDER BY publish_at DESC`, SelectPost, SelectPost) */
17 )
18 
19 const (
20@@ -1025,53 +1013,6 @@ func (me *PsqlDB) FindTagsForPost(postID string) ([]string, error) {
21 	return tags, nil
22 }
23 
24-/* func (me *PsqlDB) FindPostsWithTagsForUser(userID, space string) ([]*db.Post, error) {
25-	var posts []*db.Post
26-	rs, err := me.Db.Query(sqlSelectUserPostsWithTags, userID, space)
27-	if err != nil {
28-		return posts, err
29-	}
30-	for rs.Next() {
31-		tagStr := ""
32-		post := &db.Post{}
33-		err := rs.Scan(
34-			&post.ID,
35-			&post.UserID,
36-			&post.Username,
37-			&post.Filename,
38-			&post.Slug,
39-			&post.Title,
40-			&post.Text,
41-			&post.Description,
42-			&post.CreatedAt,
43-			&post.PublishAt,
44-			&post.UpdatedAt,
45-			&post.Hidden,
46-			&post.FileSize,
47-			&post.MimeType,
48-			&post.Shasum,
49-			&tagStr,
50-		)
51-		if err != nil {
52-			return nil, err
53-		}
54-		tags := strings.Split(tagStr, ",")
55-		for _, tag := range tags {
56-			tg := strings.TrimSpace(tag)
57-			if tg == "" {
58-				continue
59-			}
60-			post.Tags = append(post.Tags, tg)
61-		}
62-
63-		posts = append(posts, post)
64-	}
65-	if rs.Err() != nil {
66-		return posts, rs.Err()
67-	}
68-	return posts, nil
69-} */
70-
71 func (me *PsqlDB) HasFeatureForUser(userID string, feature string) bool {
72 	var id string
73 	err := me.Db.QueryRow(sqlSelectFeatureForUser, userID, feature).Scan(&id)
M feeds/html/marketing.page.tmpl
+3, -0
 1@@ -88,6 +88,9 @@
 2             We don't do anything with your email besides send an email digest.
 3             If you delete the post containing your email address, we no longer have you email address.
 4         </p>
 5+        <p>
 6+            Posts are also not accessible by the public and we provide no endpoints to view these posts.
 7+        </p>
 8     </section>
 9 
10     <section>