You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
16 lines
379 B
16 lines
379 B
from app.models.pin import Pin
|
|
|
|
|
|
def pin_serialize(pin: list) -> Pin:
|
|
return Pin(**{
|
|
"id": str(pin["_id"]),
|
|
"title": pin["title"],
|
|
"description": pin["description"]
|
|
})
|
|
|
|
def pins_serialize(pins: list) -> list:
|
|
serialized_pins: list = []
|
|
for pin in pins:
|
|
serialized_pins.append(pin_serialize(pin))
|
|
|
|
return serialized_pins |