Skip to content

Commit

Permalink
nit: fix comment and validation
Browse files Browse the repository at this point in the history
  • Loading branch information
zz-hh-aa committed Jan 28, 2025
1 parent b2d7fe5 commit e86955c
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 6 deletions.
5 changes: 0 additions & 5 deletions api.planx.uk/modules/analytics/metabase/collection/service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,6 @@ import type { NewCollectionParams } from "./types.js";
import { getTeamIdAndMetabaseId } from "./getTeamIdAndMetabaseId.js";
import { createCollection } from "./createCollection.js";

/**
* The `getTeamIdAndMetabaseId()` function is run here to first get teams.id and .metabase_id from PlanX db, if present,
* so that the service can figure out if it needs to run `createCollection()` or not.
* Instead of running `getTeamIdAndMetabaseId()` first in the controller, it is encapsulated in `createTeamCollection` to keep business logic in `service.ts` instead of `controller.ts`.
*/
export async function createTeamCollection({
slug,
parentId,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export type MetabaseCollectionParams = Omit<NewCollectionParams, "slug"> & {

export const createTeamCollectionSchema = z.object({
params: z.object({
slug: z.string(),
slug: z.string().min(1),
}),
body: z.object({
description: z.string().optional(),
Expand Down

0 comments on commit e86955c

Please sign in to comment.