This commit is contained in:
v 2018-11-28 18:37:44 +03:00
parent 80f23b5650
commit 54eb316555

View File

@ -660,39 +660,32 @@ class Redirect extends ArticleStub {
constructor ( info ) { constructor ( info ) {
super( info ) super( info )
this.data = null
this.to = info.to this.to = info.to
this.toFragment = info.toFragment this.toFragment = info.toFragment
} }
data() {
return null
}
mimeId () { mimeId () {
return 0xffff return 0xffff
} }
store () { async storeMetadata ( ) {
return null const id = await super.storeMetadata()
} if ( ! id )
return
storeMetadata ( ) {
return super.storeMetadata()
.then( () => {
const target = new ArticleStub( this.to ) const target = new ArticleStub( this.to )
const row = [ const row = [
this.id, id,
target.urlKey(), target.urlKey(),
this.toFragment, this.toFragment,
] ]
log( '>', this.title || this.url, row) log( '>', this.title || this.url, row)
wiki.db.run( return wiki.db.run(
'INSERT INTO redirects (id, targetKey, fragment) VALUES (?,?,?)', 'INSERT INTO redirects (id, targetKey, fragment) VALUES (?,?,?)',
row row
) )
})
} }
} }