-
Notifications
You must be signed in to change notification settings - Fork 189
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Change parser to work with supabase (#3363)
- Remove wiki-feed-parser, add logic to get feeds from supabase - Update e2e test to reflect on the change - Fix Supabase configs, remove secrets from env.local - Use database staging
- Loading branch information
1 parent
9f76141
commit 3af12d5
Showing
10 changed files
with
62 additions
and
173 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
const { logger } = require('@senecacdot/satellite'); | ||
const { createClient } = require('@supabase/supabase-js'); | ||
|
||
const { SUPABASE_URL, SERVICE_ROLE_KEY } = process.env; | ||
|
||
const supabase = createClient(SUPABASE_URL, SERVICE_ROLE_KEY); | ||
|
||
if (!SUPABASE_URL || !SERVICE_ROLE_KEY) { | ||
logger.error('SUPBASE_URL or SERVICE_ROLE_KEY is missing'); | ||
process.exit(1); | ||
} | ||
|
||
module.exports = { | ||
async getAllFeeds() { | ||
const { data, error } = await supabase | ||
.from('feeds') | ||
.select('wiki_author_name, url, telescope_profiles (display_name)'); | ||
|
||
if (error) { | ||
logger.error({ error }); | ||
throw Error(error.message, "can't fetch feeds from supabase"); | ||
} | ||
|
||
return data.map((feed) => ({ | ||
// Prefer the a user's display name if present, fallback to wiki name otherwise | ||
author: feed.display_name || feed.wiki_author_name, | ||
url: feed.url, | ||
})); | ||
}, | ||
}; |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.