-
Notifications
You must be signed in to change notification settings - Fork 54
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
closes #6 * organise exports from the library * organise documentatation - move to .md file
- Loading branch information
1 parent
c3b3955
commit 8344450
Showing
25 changed files
with
1,188 additions
and
308 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import uploadFeature from '@admin-bro/upload' | ||
|
||
import { CreateResourceResult } from '../create-resource-result.type' | ||
import { Post } from '../../../post/post.entity' | ||
|
||
const createPostResource = (): CreateResourceResult<typeof Post> => ({ | ||
resource: Post, | ||
options: { | ||
listProperties: ['id', 'bucketKey', 'bucket', 'path'], | ||
}, | ||
features: [uploadFeature({ | ||
provider: { | ||
gcp: { | ||
bucket: 'admin-bro-demo-app-uploads', | ||
expires: 0, | ||
}, | ||
}, | ||
properties: { file: 'file', key: 'bucketKey', bucket: 'bucket', mimeType: 'mime' }, | ||
})], | ||
}) | ||
|
||
export default createPostResource |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
/* eslint-disable import/prefer-default-export */ | ||
/* eslint-disable import/no-cycle */ | ||
/* eslint-disable @typescript-eslint/no-unused-vars */ | ||
import { | ||
BaseEntity, | ||
Column, | ||
CreateDateColumn, | ||
Entity, | ||
PrimaryGeneratedColumn, | ||
UpdateDateColumn, | ||
OneToMany, | ||
} from 'typeorm' | ||
|
||
@Entity({ name: 'posts' }) | ||
export class Post extends BaseEntity { | ||
@PrimaryGeneratedColumn() | ||
public id: number; | ||
|
||
@Column({ nullable: true }) | ||
public name: string; | ||
|
||
@Column({ nullable: true, name: 'key' }) | ||
public bucketKey: string; | ||
|
||
@Column({ nullable: true }) | ||
public bucket: string; | ||
|
||
@Column({ nullable: true }) | ||
public path: string; | ||
|
||
@Column({ nullable: true }) | ||
public mime: string; | ||
|
||
@CreateDateColumn({ name: 'created_at' }) | ||
public createdAt: Date; | ||
|
||
@UpdateDateColumn({ name: 'updated_at' }) | ||
public updatedAt: Date; | ||
} |
Oops, something went wrong.