Skip to content

Commit

Permalink
Merge pull request #7 from not-three/feat/burn-notes
Browse files Browse the repository at this point in the history
chore: updated ci to use wrangler
fix: updated gh issue url to redirect to all issues, instead of new
fix: burn notes api response missing
  • Loading branch information
scolastico authored Nov 6, 2024
2 parents c9d36e2 + 67f550e commit c6e6db6
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 8 deletions.
6 changes: 2 additions & 4 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -72,10 +72,8 @@ jobs:
\"https://scolasti.co/go/privacy\"}" > client/config.json
- name: Upload client bundle to cloudflare
uses: cloudflare/pages-action@v1
uses: cloudflare/wrangler-action@v3
with:
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
projectName: not-three
directory: client
wranglerVersion: '3'
command: pages deploy client/ --project-name=not-three
2 changes: 1 addition & 1 deletion components/nav-bar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ function handle(entry: string) {
window.open('https://github.com/not-three/main', '_blank')
break
case 'help':
window.open('https://github.com/not-three/main/issues/new', '_blank')
window.open('https://github.com/not-three/main/issues', '_blank')
break
case 'terms':
console.log(JSON.stringify(props.config))
Expand Down
4 changes: 2 additions & 2 deletions server/api/json/[id]/[key].get.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,11 @@ export default defineEventHandler(async (event) => {
return {
success: true,
content: CryptoJS.AES.decrypt(note.content, key).toString(CryptoJS.enc.Utf8),
expires: note.burn_after_reading ? Math.floor(new Date() / 1000) : note.expires_at,
expires: note.burn_after_reading ? Math.floor(+new Date() / 1000) : note.expires_at,
burnt: note.burn_after_reading,
}
} catch (e) {
setResponseStatus(event, 400);
return {success: false, error: 'Invalid key', burn: note.burnAfterReading};
return {success: false, error: 'Invalid key', burnt: note.burn_after_reading};
}
})
2 changes: 1 addition & 1 deletion server/api/json/[id]/index.get.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export default defineEventHandler(async (event) => {
return {
success: true,
content: note.content,
expires: note.burn_after_reading ? Math.floor(new Date() / 1000) : note.expires_at,
expires: note.burn_after_reading ? Math.floor(+new Date() / 1000) : note.expires_at,
burnt: note.burn_after_reading,
}
})

0 comments on commit c6e6db6

Please sign in to comment.