This repository has been archived by the owner on Sep 30, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use SSG for chapters, groups, posts, and topics
- Loading branch information
1 parent
8dd2635
commit 802109f
Showing
14 changed files
with
161 additions
and
63 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
export * from './addToActivity'; | ||
export * from './rebuildPage'; | ||
export * from './updateParent'; | ||
export * from './updatePosts'; |
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,14 @@ | ||
import * as functions from 'firebase-functions'; | ||
import fetch from 'node-fetch'; | ||
import { Chapter } from '@zoonk/models'; | ||
|
||
/** | ||
* Call a chapter page in the frontend to rebuild it (SSG). | ||
*/ | ||
export const onUpdateChapterRebuildPage = functions.firestore | ||
.document('chapters/{id}') | ||
.onUpdate((change) => { | ||
const { language } = change.after.data() as Chapter.Response; | ||
const url = `https://${language}.zoonk.org/chapters/${change.after.id}`; | ||
return fetch(url); | ||
}); |
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 |
---|---|---|
@@ -1,3 +1,4 @@ | ||
export * from './addToActivity'; | ||
export * from './rebuildPage'; | ||
export * from './updateMyGroups'; | ||
export * from './updatePosts'; |
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,14 @@ | ||
import * as functions from 'firebase-functions'; | ||
import fetch from 'node-fetch'; | ||
import { Group } from '@zoonk/models'; | ||
|
||
/** | ||
* Call a group page in the frontend to rebuild it (SSG). | ||
*/ | ||
export const onUpdateGroupRebuildPage = functions.firestore | ||
.document('groups/{id}') | ||
.onUpdate((change) => { | ||
const { language } = change.after.data() as Group.Response; | ||
const url = `https://${language}.zoonk.org/groups/${change.after.id}`; | ||
return fetch(url); | ||
}); |
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 |
---|---|---|
@@ -1,2 +1,3 @@ | ||
export * from './addToActivity'; | ||
export * from './rebuildPage'; | ||
export * from './updateGroup'; |
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,14 @@ | ||
import * as functions from 'firebase-functions'; | ||
import fetch from 'node-fetch'; | ||
import { Post } from '@zoonk/models'; | ||
|
||
/** | ||
* Call a post page in the frontend to rebuild it (SSG). | ||
*/ | ||
export const onUpdatePostRebuildPage = functions.firestore | ||
.document('posts/{id}') | ||
.onUpdate((change) => { | ||
const { language } = change.after.data() as Post.Response; | ||
const url = `https://${language}.zoonk.org/posts/${change.after.id}`; | ||
return fetch(url); | ||
}); |
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 |
---|---|---|
@@ -1,2 +1,3 @@ | ||
export * from './addToActivity'; | ||
export * from './rebuildPage'; | ||
export * from './updateMyTopics'; |
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,14 @@ | ||
import * as functions from 'firebase-functions'; | ||
import fetch from 'node-fetch'; | ||
import { Topic } from '@zoonk/models'; | ||
|
||
/** | ||
* Call a topic page in the frontend to rebuild it (SSG). | ||
*/ | ||
export const onUpdateTopicRebuildPage = functions.firestore | ||
.document('topics/{id}') | ||
.onUpdate((change) => { | ||
const { language } = change.after.data() as Topic.Response; | ||
const url = `https://${language}.zoonk.org/topics/${change.after.id}`; | ||
return fetch(url); | ||
}); |
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
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.
802109f
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs: