Teacher model moved to typescript. Page can be loaded but looks ugly due to broken styled jsx
This commit is contained in:
1 parent
f48f89ff1b
commit
c48de3e09a
2 files changed
+20
-9
No files matched your search
@@ -1,12 +1,12 @@
|
|||||||
const Data = require('./Data')
|
import Data from './Data'
|
||||||
const Image = require('./Image')
|
import Image from './Image'
|
||||||
const { find, findOne } = require('../lib/store')
|
import { find, findOne } from '../lib/store'
|
||||||
|
|
||||||
const store = () => Data.getStore(Teacher)
|
const store = () => Data.getStore('Teacher')
|
||||||
|
|
||||||
class Teacher {
|
export default class Teacher {
|
||||||
static async find(query, options = {}) {
|
static async find(query, options = {}) {
|
||||||
const items = await find(store(), query, options)
|
const items = await find(store(), query, options as any)
|
||||||
|
|
||||||
return Promise.all(items.map(processProfile))
|
return Promise.all(items.map(processProfile))
|
||||||
}
|
}
|
||||||
@@ -18,6 +18,19 @@ class Teacher {
|
|||||||
return processProfile(data)
|
return processProfile(data)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public id: any
|
||||||
|
public post: any
|
||||||
|
public file: any
|
||||||
|
public edu: any
|
||||||
|
public picture: any
|
||||||
|
public preview: any
|
||||||
|
public diploma: any
|
||||||
|
public position: any
|
||||||
|
public name: any
|
||||||
|
public status: any
|
||||||
|
public hash: any
|
||||||
|
public url: any
|
||||||
|
|
||||||
constructor(data) {
|
constructor(data) {
|
||||||
this.id = data.id
|
this.id = data.id
|
||||||
this.post = data.post
|
this.post = data.post
|
||||||
@@ -72,5 +85,3 @@ const processProfile = async profile => {
|
|||||||
preview,
|
preview,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
module.exports = Teacher
|
|
||||||
+1
-1
@@ -40,7 +40,7 @@ function init(db) {
|
|||||||
Data.setStore('Article', db.collection('articles'))
|
Data.setStore('Article', db.collection('articles'))
|
||||||
Data.setStore(Album, db.collection('albums'))
|
Data.setStore(Album, db.collection('albums'))
|
||||||
Data.setStore('Image', db.collection('images'))
|
Data.setStore('Image', db.collection('images'))
|
||||||
Data.setStore(Teacher, db.collection('collective'))
|
Data.setStore('Teacher', db.collection('collective'))
|
||||||
Data.setStore(Document, db.collection('documents'))
|
Data.setStore(Document, db.collection('documents'))
|
||||||
Data.setStore('Settings', db.collection('settings'))
|
Data.setStore('Settings', db.collection('settings'))
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user