Alex Xu 8 mēneši atpakaļ
vecāks
revīzija
c8b73ddfde
3 mainītis faili ar 7 papildinājumiem un 8 dzēšanām
  1. 1 1
      src/db/index.ts
  2. 1 1
      src/db/models/Tiktok.ts
  3. 5 6
      src/services/tiktokService/index.ts

+ 1 - 1
src/db/index.ts

@@ -10,7 +10,7 @@ const sequelize = new Sequelize({
   host: DB_HOST,
   port: DB_PORT ? Number.parseInt(DB_PORT) : 3306,
   database: DB_NAME,
-  dialect: 'mysql',
+  dialect: 'mariadb',
   username: DB_USER,
   password: DB_PASS,
   dialectOptions: {

+ 1 - 1
src/db/models/Tiktok.ts

@@ -68,7 +68,7 @@ export default class Tiktok extends Model {
   @Default(0)
   @Column(DataType.INTEGER.UNSIGNED)
   get type(): number {
-    return this.getDataValue('order')
+    return this.getDataValue('type')
   }
 
   @AllowNull(false)

+ 5 - 6
src/services/tiktokService/index.ts

@@ -5,7 +5,6 @@ import {
   PaginateOptions,
   PaginationConnection,
 } from 'sequelize-cursor-pagination'
-import { TweetData } from '../../db/models/Tweet'
 import { TiktokData } from '../../db/models/Tiktok'
 
 const STATE = 'banana'
@@ -235,11 +234,11 @@ export interface ShotData {
 async function importShot(data: ShotData): Promise<Tiktok> {
   const { shot: shotRaw, url: urlRaw } = data
 
-  try {
-    return await generateTweetByPublishAPI(urlRaw)
-  } catch (error) {
-    // if error, use shot
-  }
+  // try {
+  //   return await generateTweetByPublishAPI(urlRaw)
+  // } catch (error) {
+  //   // if error, use shot
+  // }
 
   const shot = shotRaw.trim()