🚩 create basic flow for fetching user data
This commit is contained in:
11
src/helpers/http/userHeader/query/parseArrayQuery.ts
Normal file
11
src/helpers/http/userHeader/query/parseArrayQuery.ts
Normal file
@ -0,0 +1,11 @@
|
||||
import { Context } from "elysia";
|
||||
|
||||
export const parseArrayQuery = <T extends string = string>(
|
||||
query: Context["query"],
|
||||
key: string
|
||||
): T[] => {
|
||||
const raw = query[key];
|
||||
if (!raw) return [];
|
||||
|
||||
return raw.split(",").map((s) => s.trim()) as T[];
|
||||
};
|
||||
Reference in New Issue
Block a user