Updated docs and minor cleanup

This commit is contained in:
2024-07-15 22:49:31 +02:00
parent d6609fd335
commit 777b0fccc8
10 changed files with 56 additions and 37 deletions

View File

@@ -1,3 +1,7 @@
---
sidebar_position: 4
---
# Commands
```

View File

@@ -0,0 +1,5 @@
---
sidebar_position: 5
---
# Command plugins

View File

@@ -1,21 +1,28 @@
---
sidebar_position: 2
---
# Install
## Requirements
MycroForge has the following dependencies.
- bash
- git
- Python3 (3.10)
- Docker
- .NET 8
### Windows
To simplify the implementation of this tool, it assumes that it's running in a POSIX compliant environment.
MycroForge has been developed and tested on Windows in WSL2 Ubuntu 22.04.03.
So when running on Windows, it's recommended to run MycroForge in the same environment or atleast in a similar WSL2 distro.
---
sidebar_position: 2
---
# Getting started
## Requirements
MycroForge has the following dependencies.
- bash
- git
- Python3 (3.10)
- Docker
- .NET 8
### Windows
To simplify the implementation of this tool, it assumes that it's running in a POSIX compliant environment.
MycroForge has been developed and tested on Windows in WSL2 Ubuntu 22.04.03.
So when running on Windows, it's recommended to run MycroForge in the same environment or atleast in a similar WSL2 distro.
### Install
```
dotnet tool install -g MycroForge.CLI
```

View File

@@ -167,16 +167,18 @@ Modify `TodoService.list`
```python
# Before
async with async_session() as session:
stmt = select(Todo)
results = (await session.scalars(stmt)).all()
return results
async def list(self) -> List[Todo]:
async with async_session() as session:
stmt = select(Todo)
results = (await session.scalars(stmt)).all()
return results
# After
async with async_session() as session:
stmt = select(Todo).options(selectinload(Todo.tags))
results = (await session.scalars(stmt)).all()
return results
async def list(self) -> List[Todo]:
async with async_session() as session:
stmt = select(Todo).options(selectinload(Todo.tags))
results = (await session.scalars(stmt)).all()
return results
```
Modify `TodoService.get_by_id`
@@ -279,5 +281,6 @@ Modify `TodoService.update`
return True
```
At this point, the app should be ready to test.
TODO: Elaborate!
## Test the API!
Go to http://localhost:5000/docs and test your Todo API!