Page MenuHomeSealhub

reverse-single-reference.ts
No OneTemporary

reverse-single-reference.ts

// import { FormControl } from "./form-control";
// import { FormFieldControl } from "./form-field-control";
// import { ReverseSingleReference as ReverseSingleReferenceField } from "../fields/field";
// import { Context } from "koa";
// import { Fields } from "../..";
// import { ArrayControl } from "./array";
// export class ReverseSingleReference extends ArrayControl {
// //
// //
// // this isn't finished yet
// //
// //
// constructor(
// public field: ReverseSingleReferenceField,
// public item_controls: Array<FormControl | UnboundControlStorage>
// ) {
// super(field, item_controls);
// }
// async getItems(ctx: Context) {
// const target_id = await this.getTargetItemID(ctx);
// const { items } = await this.field.sealious_field
// .getReferencingCollection()
// .list(ctx.$context)
// .filter({
// [this.field.sealious_field.referencing_field]: target_id,
// })
// .fetch();
// return items;
// }
// makeSubfield(fieldname: string) {
// const collection = this.field.sealious_field.getReferencingCollection();
// if (!collection.fields[fieldname]) {
// return null;
// }
// return new Fields.CollectionField(false, collection.fields[fieldname]);
// }
// async add(ctx: Context): Promise<void> {
// const collection = this.field.sealious_field.getReferencingCollection();
// await collection.create(ctx.$context, {
// [this.field.sealious_field.referencing_field]:
// await this.getTargetItemID(ctx),
// ...(await this.getDefaultItemBody()),
// });
// }
// }

File Metadata

Mime Type
text/plain
Expires
Fri, Jan 24, 15:16 (17 h, 19 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
601626
Default Alt Text
reverse-single-reference.ts (1 KB)

Event Timeline