- Implemented routes for listing, retrieving, updating, and deleting containers. - Added ContainerModel with necessary fields and methods for data handling. - Created utility functions for fetching container data by ID. feat(page): enhance page management with CRUD and publish functionality - Developed routes for managing pages, including listing, updating, and deleting. - Integrated caching and zip file generation for page exports. - Added publish functionality to manage app versions and file uploads. feat(prompts): implement prompt management with CRUD operations - Created routes for listing, updating, and deleting prompts. - Added pagination and search capabilities for prompt listing. test: add common query utilities and prompt tests - Implemented common query utilities for API interactions. - Added tests for prompt listing functionality.
12 lines
306 B
TypeScript
12 lines
306 B
TypeScript
import { ContainerModel } from '../models/index.ts';
|
|
|
|
export const getContainerById = async (id: string) => {
|
|
const container = await ContainerModel.findByPk(id);
|
|
const code = container?.code;
|
|
return {
|
|
code,
|
|
id: container?.id,
|
|
updatedAt: new Date(container?.updatedAt).getTime(),
|
|
};
|
|
};
|