mirror of
https://github.com/LaCasemate/fab-manager.git
synced 2025-01-29 18:52:22 +01:00
modelise space object from API in TS
This commit is contained in:
parent
4a8fa65e5f
commit
6dc2e8e41e
@ -12,7 +12,7 @@ export interface Price {
|
||||
priceable_type: string,
|
||||
priceable_id: number,
|
||||
amount: number,
|
||||
duration: number // in minutes
|
||||
duration?: number // in minutes
|
||||
}
|
||||
|
||||
export interface ComputePriceResult {
|
||||
|
15
app/frontend/src/javascript/models/space.ts
Normal file
15
app/frontend/src/javascript/models/space.ts
Normal file
@ -0,0 +1,15 @@
|
||||
|
||||
export interface Space {
|
||||
id: number,
|
||||
name: string,
|
||||
description: string,
|
||||
slug: string,
|
||||
default_places: number,
|
||||
disabled: boolean,
|
||||
space_image: string,
|
||||
space_file_attributes?: {
|
||||
id: number,
|
||||
attachment: string,
|
||||
attachement_url: string,
|
||||
}
|
||||
}
|
@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
json.array!(@spaces) do |space|
|
||||
json.extract! space, :id, :name, :description, :slug, :default_places, :disabled
|
||||
json.space_image space.space_image.attachment.medium.url if space.space_image
|
||||
|
@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
json.extract! @space, :id, :name, :description, :characteristics, :created_at, :updated_at, :slug, :default_places, :disabled
|
||||
json.space_image @space.space_image.attachment.large.url if @space.space_image
|
||||
json.space_files_attributes @space.space_files do |f|
|
||||
@ -9,4 +11,4 @@ end
|
||||
# using the space in the space_show screen
|
||||
# json.space_projects @space.projects do |p|
|
||||
# json.extract! p, :slug, :name
|
||||
# end
|
||||
# end
|
||||
|
Loading…
x
Reference in New Issue
Block a user