Skip to content
Snippets Groups Projects
Commit 6863711c authored by Hugo Trentesaux's avatar Hugo Trentesaux
Browse files

handle deletion

parent ac79f4be
No related branches found
No related tags found
No related merge requests found
...@@ -19,3 +19,4 @@ export const EMPTY_NODE_CID = CID.parse('bafyreicvlp2p65agkxpzcboedba7zit55us4zv ...@@ -19,3 +19,4 @@ export const EMPTY_NODE_CID = CID.parse('bafyreicvlp2p65agkxpzcboedba7zit55us4zv
// document kind of old cesium plus profile imported in the indexer // document kind of old cesium plus profile imported in the indexer
export const CESIUM_PLUS_PROFILE_IMPORT = CID.parse('bafkreiawtammeqc55cssr2zepfpaxbmp7kquhikkagipvtefeadsw4mqvq') export const CESIUM_PLUS_PROFILE_IMPORT = CID.parse('bafkreiawtammeqc55cssr2zepfpaxbmp7kquhikkagipvtefeadsw4mqvq')
export const CESIUM_PLUS_PROFILE_INSERT = CID.parse('bafkreigi5phtqpo6a2f3tx4obaja4fzevy3nyvnl4bnkcxylyqnfeowzbm') export const CESIUM_PLUS_PROFILE_INSERT = CID.parse('bafkreigi5phtqpo6a2f3tx4obaja4fzevy3nyvnl4bnkcxylyqnfeowzbm')
export const CESIUM_PLUS_PROFILE_DELETE = CID.parse('bafkreic5bv5ytl7zv5rh5j2bd5mw6nfrn33mxhiobgmpsiu65yjw3eeduu')
import { CESIUM_PLUS_PROFILE_IMPORT, CESIUM_PLUS_PROFILE_INSERT } from '../consts' import { CESIUM_PLUS_PROFILE_IMPORT, CESIUM_PLUS_PROFILE_INSERT, CESIUM_PLUS_PROFILE_DELETE } from '../consts'
import type { IndexRequest } from '../types' import type { IndexRequest } from '../types'
import { CID } from 'multiformats' import { CID } from 'multiformats'
import pg from 'pg' import pg from 'pg'
...@@ -127,6 +127,12 @@ export async function handleInsertRequest(irCID: CID, ir: IndexRequest) { ...@@ -127,6 +127,12 @@ export async function handleInsertRequest(irCID: CID, ir: IndexRequest) {
break break
} }
// delete
case CESIUM_PLUS_PROFILE_DELETE.toString(): {
await client.query(`DELETE FROM profiles WHERE pubkey = $1;`, [ir.pubk])
break
}
// unimplemented // unimplemented
default: default:
console.log('🔴 unimplemented kind ' + ir.kind) console.log('🔴 unimplemented kind ' + ir.kind)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment