chore: updated webhook
c06c5946
1 file(s) · +9 −0
| 28 | 28 | if (event.type === "record") { |
|
| 29 | 29 | const { record } = event; |
|
| 30 | 30 | ||
| 31 | + | if (record.live === false) { |
|
| 32 | + | return c.json({ ok: true }); |
|
| 33 | + | } |
|
| 34 | + | ||
| 31 | 35 | if (record.collection === "site.standard.document") { |
|
| 32 | 36 | if (record.action === "create" || record.action === "update") { |
|
| 33 | 37 | await db |
|
| 145 | 149 | const events = (await c.req.json()) as Array<{ |
|
| 146 | 150 | type: string; |
|
| 147 | 151 | did: string; |
|
| 152 | + | live?: boolean; |
|
| 148 | 153 | collection?: string; |
|
| 149 | 154 | rkey?: string; |
|
| 150 | 155 | cid?: string; |
|
| 156 | 161 | ||
| 157 | 162 | for (const event of events) { |
|
| 158 | 163 | try { |
|
| 164 | + | if (event.live === false) { |
|
| 165 | + | continue; |
|
| 166 | + | } |
|
| 167 | + | ||
| 159 | 168 | if ( |
|
| 160 | 169 | (event.type === "commit" || |
|
| 161 | 170 | event.type === "create" || |
|