fix: collection options

This commit is contained in:
Chareice 2024-08-09 16:32:35 +08:00
parent aa76b78da4
commit bd77ef2bd3
No known key found for this signature in database

View File

@ -15,7 +15,10 @@ export class Collection implements ICollection {
repository: IRepository; repository: IRepository;
fields: Map<string, IField> = new Map<string, IField>(); fields: Map<string, IField> = new Map<string, IField>();
constructor(protected options: CollectionOptions, protected collectionManager: ICollectionManager) { constructor(
protected options: CollectionOptions,
protected collectionManager: ICollectionManager,
) {
this.setRepository(options.repository); this.setRepository(options.repository);
if (options.fields) { if (options.fields) {
@ -23,6 +26,10 @@ export class Collection implements ICollection {
} }
} }
get name() {
return this.options.name;
}
updateOptions(options: CollectionOptions, mergeOptions?: any) { updateOptions(options: CollectionOptions, mergeOptions?: any) {
const newOptions = { const newOptions = {
...this.options, ...this.options,