|
1 | | -import { OrbisDB } from "@useorbis/db-sdk"; |
| 1 | +//import { OrbisDB } from "@useorbis/db-sdk"; |
2 | 2 | import axios from "axios"; |
3 | 3 |
|
4 | | -const orbisdb = new OrbisDB({ |
5 | | - ceramic: { |
6 | | - gateway: process.env.NEXT_PUBLIC_CERAMIC_URL || '' |
7 | | - }, |
8 | | - nodes: [ |
9 | | - { |
10 | | - gateway: process.env.NEXT_PUBLIC_ORBIS_NODE_URL || '', |
11 | | - env: process.env.NEXT_PUBLIC_ORBIS_ENV || '' |
12 | | - } |
13 | | - ] |
14 | | - }) |
| 4 | +// const orbisdb = new OrbisDB({ |
| 5 | +// ceramic: { |
| 6 | +// gateway: process.env.NEXT_PUBLIC_CERAMIC_URL || '' |
| 7 | +// }, |
| 8 | +// nodes: [ |
| 9 | +// { |
| 10 | +// gateway: process.env.NEXT_PUBLIC_ORBIS_NODE_URL || '', |
| 11 | +// env: process.env.NEXT_PUBLIC_ORBIS_ENV || '' |
| 12 | +// } |
| 13 | +// ] |
| 14 | +// }) |
15 | 15 |
|
16 | | - const data = { |
17 | | - contexts: { |
18 | | - plurality: process.env.NEXT_PUBLIC_PLURALITY_CONTEXT, |
19 | | - }, |
20 | | - models: { |
21 | | - test_model: process.env.NEXT_PUBLIC_TEST_MODEL, |
22 | | - profile_type_model: process.env.NEXT_PUBLIC_PROFILE_TYPE_MODEL |
23 | | - } |
24 | | -} |
| 16 | +// const data = { |
| 17 | +// contexts: { |
| 18 | +// plurality: process.env.NEXT_PUBLIC_PLURALITY_CONTEXT, |
| 19 | +// }, |
| 20 | +// models: { |
| 21 | +// test_model: process.env.NEXT_PUBLIC_TEST_MODEL, |
| 22 | +// profile_type_model: process.env.NEXT_PUBLIC_PROFILE_TYPE_MODEL |
| 23 | +// } |
| 24 | +// } |
25 | 25 |
|
26 | | - export async function selectProfileType1(stream_id: string) { |
27 | | - try { |
28 | | - let selectStatement = await orbisdb.select().from(data.models.profile_type_model || '') |
29 | | - .where({ |
30 | | - stream_id: stream_id |
31 | | - }) |
32 | | - .context(process.env.NEXT_PUBLIC_PLURALITY_CONTEXT || ''); |
33 | | - // const query = selectStatement.build() |
34 | | - // console.log("Query that will be run", query) |
35 | | - const result= await selectStatement.run(); |
36 | | - // console.log("Result", result) |
37 | | - // console.log(result); |
38 | | - // columns: Array<string> |
39 | | - // rows: Array<T | Record<string, any>> |
40 | | - const { columns, rows } = result |
41 | | - // console.log({ columns, rows }); |
42 | | - return { columns, rows }; |
43 | | - } |
44 | | - catch (error) { |
45 | | - console.log("Error", error) |
46 | | - } |
47 | | - } |
| 26 | +// export async function selectProfileType1(stream_id: string) { |
| 27 | +// try { |
| 28 | +// let selectStatement = await orbisdb.select().from(data.models.profile_type_model || '') |
| 29 | +// .where({ |
| 30 | +// stream_id: stream_id |
| 31 | +// }) |
| 32 | +// .context(process.env.NEXT_PUBLIC_PLURALITY_CONTEXT || ''); |
| 33 | +// // const query = selectStatement.build() |
| 34 | +// // console.log("Query that will be run", query) |
| 35 | +// const result= await selectStatement.run(); |
| 36 | +// // console.log("Result", result) |
| 37 | +// // console.log(result); |
| 38 | +// // columns: Array<string> |
| 39 | +// // rows: Array<T | Record<string, any>> |
| 40 | +// const { columns, rows } = result |
| 41 | +// // console.log({ columns, rows }); |
| 42 | +// return { columns, rows }; |
| 43 | +// } |
| 44 | +// catch (error) { |
| 45 | +// console.log("Error", error) |
| 46 | +// } |
| 47 | +// } |
48 | 48 |
|
49 | 49 |
|
50 | 50 | export async function selectProfileType(stream_id: string) { |
|
0 commit comments