-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactor and update dummy server actions to satisfy linter
- Loading branch information
1 parent
225899e
commit efe7788
Showing
7 changed files
with
46 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,15 @@ | ||
"use server" | ||
|
||
import { type addBrandSchema } from "@/validations/inventory" | ||
import { type brandSchema } from "@/validations/inventory" | ||
import type { z } from "zod" | ||
|
||
export async function addNewBrand(input: z.infer<typeof addBrandSchema>) { | ||
export async function addNewBrand(input: z.infer<typeof brandSchema>) { | ||
console.log(input.name) | ||
return "success" | ||
console.log("Adding brand to the database...") | ||
return new Promise((resolve) => { | ||
setTimeout(() => { | ||
console.log("Brand added to the database") | ||
resolve("success") | ||
}, 1000) | ||
}) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,15 @@ | ||
"use server" | ||
|
||
import { type addCategorySchema } from "@/validations/inventory" | ||
import type { categorySchema } from "@/validations/inventory" | ||
import type { z } from "zod" | ||
|
||
export async function addNewCategory(input: z.infer<typeof addCategorySchema>) { | ||
export async function addCategory(input: z.infer<typeof categorySchema>) { | ||
console.log(input.name, input.description) | ||
return "success" | ||
console.log("Adding new category to the database") | ||
return new Promise((resolve) => { | ||
setTimeout(() => { | ||
console.log("Category added to the database") | ||
resolve("success") | ||
}, 1000) | ||
}) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,15 @@ | ||
"use server" | ||
|
||
import { type addUnitSchema } from "@/validations/inventory" | ||
import type { unitSchema } from "@/validations/inventory" | ||
import type { z } from "zod" | ||
|
||
export async function addNewUnit(input: z.infer<typeof addUnitSchema>) { | ||
export async function addNewUnit(input: z.infer<typeof unitSchema>) { | ||
console.log(input.name, input.abbreviation) | ||
return "success" | ||
console.log("Adding unit to the database...") | ||
return new Promise((resolve) => { | ||
setTimeout(() => { | ||
console.log("Unit added to the database") | ||
resolve("success") | ||
}, 1000) | ||
}) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,18 @@ | ||
"use server" | ||
|
||
import { type addWarehouseSchema } from "@/validations/warehouses" | ||
import type { warehouseSchema } from "@/validations/warehouses" | ||
import type { z } from "zod" | ||
|
||
export async function addNewWarehouse( | ||
input: z.infer<typeof addWarehouseSchema> | ||
) { | ||
export async function addWarehouse(input: z.infer<typeof warehouseSchema>) { | ||
console.log(input.name) | ||
console.log(input.type) | ||
console.log(input.description) | ||
console.log(input.location) | ||
return "success" | ||
console.log("Adding warehouse to the database...") | ||
return new Promise((resolve) => { | ||
setTimeout(() => { | ||
console.log("Warehouse added to the database") | ||
resolve("success") | ||
}, 1000) | ||
}) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters