refactor: remove console.log statements for cleaner code
This commit is contained in:
parent
899289f6f8
commit
25e4e15eec
4 changed files with 2 additions and 14 deletions
|
|
@ -45,7 +45,7 @@ import { UserAvatar } from "../user_avatar";
|
|||
|
||||
export const Appunti = () => {
|
||||
const { data, columns, setData, removeColumn } = useAppunti();
|
||||
console.log("Appunti data:", data);
|
||||
|
||||
return (
|
||||
<ScrollArea className="w-screen pr-2 sm:w-full">
|
||||
<KanbanProvider
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@ type AppuntiContextType = {
|
|||
data: AppuntiData[];
|
||||
columns: AppuntiGroups[];
|
||||
setData: (data: AppuntiData[]) => void;
|
||||
updateCall: () => void;
|
||||
|
||||
addItem: (item: NewAppunti) => void;
|
||||
removeItem: (id: AppuntiId) => void;
|
||||
removeColumn: (id: AppuntiGroupsId) => void;
|
||||
|
|
@ -69,7 +69,6 @@ export const AppuntiProvider = ({ children }: AppuntiProviderProps) => {
|
|||
...item,
|
||||
posizione: index,
|
||||
}));
|
||||
console.log("Setting data with positions:", dataWithPositions);
|
||||
utils.appunti.getAppunti.setData(undefined, dataWithPositions);
|
||||
updateAppuntiMutation({
|
||||
data: dataWithPositions,
|
||||
|
|
@ -83,14 +82,6 @@ export const AppuntiProvider = ({ children }: AppuntiProviderProps) => {
|
|||
},
|
||||
});
|
||||
|
||||
const updateCall = () => {
|
||||
const data = utils.appunti.getAppunti.getData();
|
||||
console.log("Updating Appunti with data:", data);
|
||||
// updateAppuntiMutation({
|
||||
// data: data || [],
|
||||
// });
|
||||
};
|
||||
|
||||
const { mutate: addColumnMutation } = api.appunti.addAppuntiGroup.useMutation(
|
||||
{
|
||||
onSuccess: async () => {
|
||||
|
|
@ -140,7 +131,6 @@ export const AppuntiProvider = ({ children }: AppuntiProviderProps) => {
|
|||
data: data || [],
|
||||
columns: columns || [],
|
||||
setData,
|
||||
updateCall,
|
||||
addItem,
|
||||
removeItem,
|
||||
addColumn,
|
||||
|
|
|
|||
|
|
@ -42,7 +42,6 @@ export const appuntiRouter = createTRPCRouter({
|
|||
}),
|
||||
)
|
||||
.mutation(async ({ input }) => {
|
||||
console.log(input.data);
|
||||
return await updateAppunti(input.data);
|
||||
}),
|
||||
updateAppunto: adminProcedure
|
||||
|
|
|
|||
|
|
@ -132,7 +132,6 @@ export const updateAppunti = async (data: AppuntiData[]) => {
|
|||
...item,
|
||||
posizione: index,
|
||||
}));
|
||||
console.log("Data with positions to update:", dataWithPositions);
|
||||
|
||||
for (const item of dataWithPositions) {
|
||||
const { column, username: _username, ...rest } = item;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue